From 07339e61c0820de984c9d19e74451c58a0797e3b Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 6 Dec 2015 23:22:25 +0000 Subject: [PATCH] Customizer: Apply `customize_dynamic_setting_class` and `customize_dynamic_setting_args` filters in calls to `WP_Customize_Manager::add_setting( $id, $args )`. Ensure that plugin filters apply as expected for any settings registered statically without passing in an explicit class instance to `WP_Customize_Manager::add_setting()`. Fixes #34597. Built from https://develop.svn.wordpress.org/trunk@35810 git-svn-id: http://core.svn.wordpress.org/trunk@35774 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 10 +++++++++- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index e95e115b6d..daa15e655f 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1049,7 +1049,15 @@ final class WP_Customize_Manager { if ( $id instanceof WP_Customize_Setting ) { $setting = $id; } else { - $setting = new WP_Customize_Setting( $this, $id, $args ); + $class = 'WP_Customize_Setting'; + + /** This filter is documented in wp-includes/class-wp-customize-manager.php */ + $args = apply_filters( 'customize_dynamic_setting_args', $args, $id ); + + /** This filter is documented in wp-includes/class-wp-customize-manager.php */ + $class = apply_filters( 'customize_dynamic_setting_class', $class, $id, $args ); + + $setting = new $class( $this, $id, $args ); } $this->settings[ $setting->id ] = $setting; diff --git a/wp-includes/version.php b/wp-includes/version.php index 8977048600..ce938bb0ea 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-35809'; +$wp_version = '4.5-alpha-35810'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.