Plugin Directory

Changeset 3267053


Ignore:
Timestamp:
04/04/2025 07:00:28 PM (12 months ago)
Author:
videlin
Message:

Read Ordered List nonce from JS variable.

Location:
showcase-creator
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • showcase-creator/tags/1.0.9/src/class.php

    r3239647 r3267053  
    193193                        array( 'taxs' => array( 'label', 'name', 'object_type', 'labels' ) )
    194194                    );
     195                    $admin_vars['nonces'] = $admin_vars['nonces'] ?? array();
     196                    $admin_vars['nonces']['ordered_list'] = wp_create_nonce( 'sc_ordered_list_update' );
    195197                    return $admin_vars;
    196198                } );
  • showcase-creator/tags/1.0.9/src/ordered-lists.js

    r3239647 r3267053  
    767767    function sendRequest( key, act, req ) {
    768768        loading.open();
    769         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     769        const nonce = window.showcaseCreator.nonces.ordered_list;
    770770        showcaseCreator
    771771            .ajax( {
     
    15171517            return;
    15181518        }
    1519         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     1519        const nonce = window.showcaseCreator.nonces.ordered_list;
    15201520        loading.open();
    15211521        if ( mode === 0 || mode === 1 ) {
     
    16351635            .map( i => i.valueAttr )
    16361636            .join( ',' );
    1637         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     1637        const nonce = window.showcaseCreator.nonces.ordered_list;
    16381638        loading.open();
    16391639        showcaseCreator
  • showcase-creator/tags/1.0.9/src/ordered-lists.php

    r3239647 r3267053  
    145145                        <?php esc_html_e( 'Export', 'showcase-creator' ); ?>
    146146                    </button>
    147                     <button id="save-order" class="button-primary" nonce="<?php
    148                         echo esc_attr( wp_create_nonce( 'sc_ordered_list_update' ) );
    149                     ?>"><?php esc_html_e( 'Save order', 'showcase-creator' ); ?></button>
     147                    <button id="save-order" class="button-primary">
     148                        <?php esc_html_e( 'Save order', 'showcase-creator' ); ?>
     149                    </button>
    150150                </div>
    151151            </div>
  • showcase-creator/trunk/src/class.php

    r3239647 r3267053  
    193193                        array( 'taxs' => array( 'label', 'name', 'object_type', 'labels' ) )
    194194                    );
     195                    $admin_vars['nonces'] = $admin_vars['nonces'] ?? array();
     196                    $admin_vars['nonces']['ordered_list'] = wp_create_nonce( 'sc_ordered_list_update' );
    195197                    return $admin_vars;
    196198                } );
  • showcase-creator/trunk/src/ordered-lists.js

    r3190704 r3267053  
    767767    function sendRequest( key, act, req ) {
    768768        loading.open();
    769         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     769        const nonce = window.showcaseCreator.nonces.ordered_list;
    770770        showcaseCreator
    771771            .ajax( {
     
    15171517            return;
    15181518        }
    1519         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     1519        const nonce = window.showcaseCreator.nonces.ordered_list;
    15201520        loading.open();
    15211521        if ( mode === 0 || mode === 1 ) {
     
    16351635            .map( i => i.valueAttr )
    16361636            .join( ',' );
    1637         const nonce = document.getElementById( 'save-order' ).getAttribute( 'nonce' );
     1637        const nonce = window.showcaseCreator.nonces.ordered_list;
    16381638        loading.open();
    16391639        showcaseCreator
  • showcase-creator/trunk/src/ordered-lists.php

    r3190704 r3267053  
    145145                        <?php esc_html_e( 'Export', 'showcase-creator' ); ?>
    146146                    </button>
    147                     <button id="save-order" class="button-primary" nonce="<?php
    148                         echo esc_attr( wp_create_nonce( 'sc_ordered_list_update' ) );
    149                     ?>"><?php esc_html_e( 'Save order', 'showcase-creator' ); ?></button>
     147                    <button id="save-order" class="button-primary">
     148                        <?php esc_html_e( 'Save order', 'showcase-creator' ); ?>
     149                    </button>
    150150                </div>
    151151            </div>
Note: See TracChangeset for help on using the changeset viewer.