diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index 9f72966734..d176d6aa2a 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -206,6 +206,19 @@ class WP_Customize_Setting { } } + /** + * Reset `$aggregated_multidimensionals` static variable. + * + * This is intended only for use by unit tests. + * + * @since 4.5.0 + * @access public + * @ignore + */ + static public function reset_aggregated_multidimensionals() { + self::$aggregated_multidimensionals = array(); + } + /** * The ID for the current site when the preview() method was called. * diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 0b7b7ceac2..0a73953167 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -99,7 +99,7 @@ final class WP_Customize_Widgets { } add_filter( 'customize_dynamic_setting_args', array( $this, 'filter_customize_dynamic_setting_args' ), 10, 2 ); - add_action( 'after_setup_theme', array( $this, 'register_settings' ) ); + add_action( 'widgets_init', array( $this, 'register_settings' ), 95 ); add_action( 'wp_loaded', array( $this, 'override_sidebars_widgets_for_theme_switch' ) ); add_action( 'customize_controls_init', array( $this, 'customize_controls_init' ) ); add_action( 'customize_register', array( $this, 'schedule_customize_register' ), 1 ); @@ -376,6 +376,8 @@ final class WP_Customize_Widgets { public function customize_register() { global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_sidebars; + add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 ); + $sidebars_widgets = array_merge( array( 'wp_inactive_widgets' => array() ), array_fill_keys( array_keys( $wp_registered_sidebars ), array() ), @@ -509,8 +511,6 @@ final class WP_Customize_Widgets { $this->manager->get_setting( $new_setting_id )->preview(); } } - - add_filter( 'sidebars_widgets', array( $this, 'preview_sidebars_widgets' ), 1 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index becb457924..2af113e24b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-RC1-37165'; +$wp_version = '4.5-RC1-37166'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.