WordPress.org

Make WordPress Core

Changeset 27524


Ignore:
Timestamp:
03/13/2014 06:37:24 PM (8 years ago)
Author:
ocean90
Message:

Widget Customizer: Use ?wp_customize=on.

Let _wp_customize_include() handle customizer initialisation.
Sets also the priority for the Add Widget and Reorder buttons and removes debug cruft.

props westonruter.
fixes #27291.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r27419 r27524  
    15891589
    15901590function wp_ajax_update_widget() {
    1591     require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
    1592     $GLOBALS['wp_customize'] = new WP_Customize_Manager;
    1593 
    15941591    WP_Customize_Widgets::wp_ajax_update_widget();
    15951592}
  • trunk/src/wp-admin/js/customize-widgets.js

    r27436 r27524  
    11331133            params = {};
    11341134            params.action = self.update_widget_ajax_action;
     1135            params.wp_customize = 'on';
    11351136            params[self.update_widget_nonce_post_key] = self.update_widget_nonce_value;
    11361137
     
    11541155            data += '&' + widget_content.find( '~ :input' ).serialize();
    11551156
    1156             window.console && window.console.log( wp.ajax.settings.url, data );
    11571157            jqxhr = $.post( wp.ajax.settings.url, data, function ( r ) {
    11581158                var message,
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r27419 r27524  
    322322                            'section' => $section_id,
    323323                            'sidebar_id' => $sidebar_id,
    324                             //'priority' => 99, // so it appears at the end
     324                            'priority' => count( $sidebar_widget_ids ), // place Add Widget & Reorder buttons at end
    325325                        )
    326326                    );
Note: See TracChangeset for help on using the changeset viewer.