From bc982b39c14d2bbd219e9839aac39440c6b6aa9d Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Fri, 17 Oct 2014 21:21:19 +0000 Subject: [PATCH] Customizer: Introduce `customize_preview_$setting->type` action to handle multiple settings of the same type. props celloexpressions. fixes #29165. Built from https://develop.svn.wordpress.org/trunk@29948 git-svn-id: http://core.svn.wordpress.org/trunk@29697 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-setting.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index a516b21864..8fee90ce72 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -124,7 +124,7 @@ class WP_Customize_Setting { default : /** - * Fires when the WP_Customize_Setting::preview() method is called for settings + * Fires when the {@see WP_Customize_Setting::preview()} method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, $this->id, refers to the setting ID. @@ -133,7 +133,19 @@ class WP_Customize_Setting { * * @param WP_Customize_Setting $this WP_Customize_Setting instance. */ - do_action( 'customize_preview_' . $this->id, $this ); + do_action( "customize_preview_{$this->id}", $this ); + + /** + * Fires when the {@see WP_Customize_Setting::preview()} method is called for settings + * not handled as theme_mods or options. + * + * The dynamic portion of the hook name, $this->type, refers to the setting type. + * + * @since 4.1.0 + * + * @param WP_Customize_Setting $this WP_Customize_Setting instance. + */ + do_action( "customize_preview_{$this->type}", $this ); } }