WordPress.org

Make WordPress Core

Changeset 27818


Ignore:
Timestamp:
03/28/2014 03:01:41 PM (8 years ago)
Author:
ocean90
Message:

Widget Customizer: Remove UPDATE_WIDGET_AJAX_ACTION and UPDATE_WIDGET_NONCE_POST_KEY constants.

see #27534.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r27816 r27818  
    1010 */
    1111final class WP_Customize_Widgets {
    12     const UPDATE_WIDGET_AJAX_ACTION    = 'update-widget';
    13     const UPDATE_WIDGET_NONCE_POST_KEY = 'update-sidebar-widgets-nonce';
    14 
    1512    /**
    1613     * @access public
     
    135132            ( defined( 'DOING_AJAX' ) && DOING_AJAX )
    136133            &&
    137             $this->get_post_value( 'action' ) === self::UPDATE_WIDGET_AJAX_ACTION
     134            $this->get_post_value( 'action' ) === 'update-widget'
    138135            &&
    139             check_ajax_referer( self::UPDATE_WIDGET_AJAX_ACTION, self::UPDATE_WIDGET_NONCE_POST_KEY, false )
     136            check_ajax_referer( 'update-widget', 'update-widget-nonce', false )
    140137        );
    141138
     
    578575        global $wp_scripts;
    579576        $exports = array(
    580             'update_widget_ajax_action' => self::UPDATE_WIDGET_AJAX_ACTION,
    581             'update_widget_nonce_value' => wp_create_nonce( self::UPDATE_WIDGET_AJAX_ACTION ),
    582             'update_widget_nonce_post_key' => self::UPDATE_WIDGET_NONCE_POST_KEY,
     577            'update_widget_ajax_action' => 'update-widget',
     578            'update_widget_nonce_value' => wp_create_nonce( 'update-widget' ),
     579            'update_widget_nonce_post_key' => 'update-widget-nonce',
    583580            'registered_sidebars' => array_values( $GLOBALS['wp_registered_sidebars'] ),
    584581            'registered_widgets' => $GLOBALS['wp_registered_widgets'],
     
    11631160        }
    11641161
    1165         check_ajax_referer( self::UPDATE_WIDGET_AJAX_ACTION, self::UPDATE_WIDGET_NONCE_POST_KEY );
     1162        check_ajax_referer( 'update-widget', 'update-widget-nonce' );
    11661163
    11671164        if ( ! current_user_can( 'edit_theme_options' ) ) {
     
    11731170        }
    11741171
    1175         unset( $_POST[self::UPDATE_WIDGET_NONCE_POST_KEY], $_POST['action'] );
     1172        unset( $_POST['update-widget-nonce'], $_POST['action'] );
    11761173
    11771174        do_action( 'load-widgets.php' );
Note: See TracChangeset for help on using the changeset viewer.