customize_update_{$this->type}
云策文档标注
概述
customize_update_{$this->type} 是一个 WordPress 动态 Hook,在 WP_Customize_Setting::update() 方法被调用时触发,专门用于处理非 theme_mods 或 options 类型的设置。
关键要点
- 这是一个动态 Hook,其名称中的 $this->type 部分根据设置类型动态变化。
- 触发时机:当 WP_Customize_Setting::update() 方法被调用,且设置不是 theme_mods 或 options 类型时。
- 参数:$value(设置的值)和 $setting(WP_Customize_Setting 实例)。
- 相关函数:WP_Customize_Setting::update() 用于保存设置值。
- 版本历史:自 WordPress 3.4.0 引入。
原文内容
Fires when the WP_Customize_Setting::update() method is called for settings not handled as theme_mods or options.
Description
The dynamic portion of the hook name, $this->type, refers to the type of setting.
Parameters
$valuemixed-
Value of the setting.
$settingWP_Customize_Setting-
WP_Customize_Setting instance.
Source
do_action( "customize_update_{$this->type}", $value, $this );
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |