wp_print_footer_scripts()
云策文档标注
概述
wp_print_footer_scripts() 是一个 WordPress 函数,用于触发一个 Action Hook,以在页面底部打印脚本和样式。它通过 do_action() 调用,允许开发者添加自定义回调函数。
关键要点
- wp_print_footer_scripts() 是一个 Action Hook,在页脚脚本打印时触发。
- 它使用 do_action('wp_print_footer_scripts') 来执行已添加到该 Hook 的回调函数。
- 该函数自 WordPress 2.8.0 版本引入,主要用于管理页脚资源加载。
- 相关用途包括 _wp_get_iframed_editor_assets() 函数,用于收集编辑器 iframe 中的块编辑器资源。
原文内容
Hooks to print the scripts and styles in the footer.
Source
function wp_print_footer_scripts() {
/**
* Fires when footer scripts are printed.
*
* @since 2.8.0
*/
do_action( 'wp_print_footer_scripts' );
}
Hooks
- do_action( ‘wp_print_footer_scripts’ )
-
Fires when footer scripts are printed.
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |