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
This commit is contained in:
parent
cbc554946b
commit
bc982b39c1
|
@ -124,7 +124,7 @@ class WP_Customize_Setting {
|
||||||
default :
|
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.
|
* not handled as theme_mods or options.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $this->id, refers to the setting ID.
|
* 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.
|
* @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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue