diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php
index 0b7b7ce..0a73953 100644
|
|
final class WP_Customize_Widgets { |
99 | 99 | } |
100 | 100 | |
101 | 101 | 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 ); |
103 | 103 | add_action( 'wp_loaded', array( $this, 'override_sidebars_widgets_for_theme_switch' ) ); |
104 | 104 | add_action( 'customize_controls_init', array( $this, 'customize_controls_init' ) ); |
105 | 105 | add_action( 'customize_register', array( $this, 'schedule_customize_register' ), 1 ); |
… |
… |
final class WP_Customize_Widgets { |
376 | 376 | public function customize_register() { |
377 | 377 | global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars; |
378 | 378 | |
| 379 | add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 ); |
| 380 | |
379 | 381 | $sidebars_widgets = array_merge( |
380 | 382 | array( 'wp_inactive_widgets' => array() ), |
381 | 383 | array_fill_keys( array_keys( $wp_registered_sidebars ), array() ), |
… |
… |
final class WP_Customize_Widgets { |
509 | 511 | $this->manager->get_setting( $new_setting_id )->preview(); |
510 | 512 | } |
511 | 513 | } |
512 | | |
513 | | add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 ); |
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
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 { |
70 | 70 | |
71 | 71 | function set_customized_post_data( $customized ) { |
72 | 72 | $_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 | } |
73 | 78 | } |
74 | 79 | |
75 | 80 | function do_customize_boot_actions() { |