customize_controls_print_scripts
云策文档标注
概述
customize_controls_print_scripts 是一个 WordPress 动作钩子,在主题定制器屏幕的 <head> 部分打印脚本时触发。它类似于 wp_head 钩子,但仅适用于主题定制器界面。
关键要点
- 此钩子在主题定制器屏幕的 <head> 部分触发,用于打印控制脚本。
- 默认情况下,print_head_scripts() 函数以优先级 20 添加到此钩子。
- 与 wp_head 钩子功能类似,但仅影响主题定制器屏幕;通常建议在主题定制 API 中使用 wp_head 钩子。
- 源调用为 do_action( 'customize_controls_print_scripts' )。
- 从 WordPress 3.4.0 版本引入。
注意事项
如果需要在页脚打印脚本,可以使用 customize_controls_print_footer_scripts 钩子。
原文内容
Fires when Customizer control scripts are printed.
Source
do_action( 'customize_controls_print_scripts' );
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
Skip to note 2 content
Alvaro Torres
If you want it in the footer you can use:
customize_controls_print_footer_scripts