WordPress.org

Make WordPress Core

Ticket #27291: 27291.2.diff

File 27291.2.diff, 1.8 KB (added by westonruter, 8 years ago)

Refreshed patch by resolving conflicts introduced by #27298. Commits (also rebased onto master) have also been pushed up to a branch on our GitHub clone of develop.git.wordpress.org: https://github.com/x-team/wordpress-develop/compare/trac-27291

  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index 788bd0c..44d378d 100644
    function wp_ajax_save_widget() { 
    15881588}
    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}
    15961593
  • src/wp-admin/js/customize-widgets.js

    diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
    index fc6028b..cb0b3be 100644
    var WidgetCustomizer = ( function ($) { 
    11321132
    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
    11371138                        data = $.param( params );
    var WidgetCustomizer = ( function ($) { 
    11531154                        }
    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,
    11591159                                        sanitized_form,
  • src/wp-includes/class-wp-customize-widgets.php

    diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php
    index 8b0c6f6..98f023e 100644
    class WP_Customize_Widgets { 
    321321                                                array(
    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                                        );
    327327                                        $new_setting_ids[] = $setting_id;