Make WordPress Core

Ticket #36389: 36389.0.diff

File 36389.0.diff, 1.5 KB (added by westonruter, 8 years ago)
  • 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 0b7b7ce..90932eb 100644
    final class WP_Customize_Widgets { 
    9999                }
    100100
    101101                add_filter( 'customize_dynamic_setting_args',          array( $this, 'filter_customize_dynamic_setting_args' ), 10, 2 );
    102                 add_action( 'after_setup_theme',                       array( $this, 'register_settings' ) );
     102                add_action( 'widgets_init',                            array( $this, 'register_settings' ), 95 );
    103103                add_action( 'wp_loaded',                               array( $this, 'override_sidebars_widgets_for_theme_switch' ) );
    104104                add_action( 'customize_controls_init',                 array( $this, 'customize_controls_init' ) );
    105105                add_action( 'customize_register',                      array( $this, 'schedule_customize_register' ), 1 );
  • tests/phpunit/tests/customize/widgets.php

    diff --git tests/phpunit/tests/customize/widgets.php tests/phpunit/tests/customize/widgets.php
    index 28392fd..f5eb464 100644
    class Tests_WP_Customize_Widgets extends WP_UnitTestCase { 
    7070
    7171        function set_customized_post_data( $customized ) {
    7272                $_POST['customized'] = wp_slash( wp_json_encode( $customized ) );
     73                if ( $this->manager ) {
     74                        foreach ( $customized as $id => $value ) {
     75                                $this->manager->set_post_value( $id, $value );
     76                        }
     77                }
    7378        }
    7479
    7580        function do_customize_boot_actions() {