mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@35810 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user