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. git-svn-id: https://develop.svn.wordpress.org/trunk@27524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
22eb8b34ef
commit
91fbdbbcc4
|
@ -1588,9 +1588,6 @@ function wp_ajax_save_widget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_ajax_update_widget() {
|
function wp_ajax_update_widget() {
|
||||||
require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
|
||||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager;
|
|
||||||
|
|
||||||
WP_Customize_Widgets::wp_ajax_update_widget();
|
WP_Customize_Widgets::wp_ajax_update_widget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1132,6 +1132,7 @@ var WidgetCustomizer = ( function ($) {
|
||||||
|
|
||||||
params = {};
|
params = {};
|
||||||
params.action = self.update_widget_ajax_action;
|
params.action = self.update_widget_ajax_action;
|
||||||
|
params.wp_customize = 'on';
|
||||||
params[self.update_widget_nonce_post_key] = self.update_widget_nonce_value;
|
params[self.update_widget_nonce_post_key] = self.update_widget_nonce_value;
|
||||||
|
|
||||||
data = $.param( params );
|
data = $.param( params );
|
||||||
|
@ -1153,7 +1154,6 @@ var WidgetCustomizer = ( function ($) {
|
||||||
}
|
}
|
||||||
data += '&' + widget_content.find( '~ :input' ).serialize();
|
data += '&' + widget_content.find( '~ :input' ).serialize();
|
||||||
|
|
||||||
window.console && window.console.log( wp.ajax.settings.url, data );
|
|
||||||
jqxhr = $.post( wp.ajax.settings.url, data, function ( r ) {
|
jqxhr = $.post( wp.ajax.settings.url, data, function ( r ) {
|
||||||
var message,
|
var message,
|
||||||
sanitized_form,
|
sanitized_form,
|
||||||
|
|
|
@ -321,7 +321,7 @@ class WP_Customize_Widgets {
|
||||||
array(
|
array(
|
||||||
'section' => $section_id,
|
'section' => $section_id,
|
||||||
'sidebar_id' => $sidebar_id,
|
'sidebar_id' => $sidebar_id,
|
||||||
//'priority' => 99, // so it appears at the end
|
'priority' => count( $sidebar_widget_ids ), // place Add Widget & Reorder buttons at end
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$new_setting_ids[] = $setting_id;
|
$new_setting_ids[] = $setting_id;
|
||||||
|
|
Loading…
Reference in New Issue