print_footer_scripts
云策文档标注
概述
print_footer_scripts 是一个 WordPress 过滤器,用于控制是否打印页脚脚本。它允许开发者动态修改脚本打印行为,默认值为 true。
关键要点
- 过滤器名称:print_footer_scripts
- 参数:$print(布尔值),表示是否打印页脚脚本,默认 true
- 用途:在 print_footer_scripts() 函数中应用,影响脚本加载
- 相关函数:print_footer_scripts() 位于 wp-includes/script-loader.php,负责打印队列中的页脚脚本
- 引入版本:WordPress 2.8.0
原文内容
Filters whether to print the footer scripts.
Parameters
$printbool-
Whether to print the footer scripts. Default true.
Source
if ( apply_filters( 'print_footer_scripts', true ) ) {
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |