Customizer: Introduce customize_preview_$setting->type
action to handle multiple settings of the same type.
props celloexpressions. fixes #29165. git-svn-id: https://develop.svn.wordpress.org/trunk@29948 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c4a5809baf
commit
12c39b7f4a
@ -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
Block a user