block_footer_area()
云策文档标注
概述
block_footer_area() 是一个 WordPress 函数,用于输出页脚区块模板部分。它基于 block_template_part() 实现,适用于全站编辑(FSE)或区块主题开发。
关键要点
- 函数 block_footer_area() 调用 block_template_part('footer') 来打印页脚区块模板部分。
- 该函数从 WordPress 5.9.0 版本开始引入,主要用于区块主题或全站编辑环境。
- 在混合主题中使用时,需注意:当在传统 PHP 模板的 footer.php 中调用时,它不会像在 FSE 模板或模板部分中那样转换页脚区域内的短代码,其他功能正常。
原文内容
Prints the footer block template part.
Source
function block_footer_area() {
block_template_part( 'footer' );
}
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
Skip to note 2 content
jonroc804
If you are using this to create a hybrid theme this will not convert shortcodes that are inside the footer area when called in the footer.php of an old-style PHP template the way it does when it’s used inside a FSE template or template part. Everything else seems to function as expected.