Bricks 中文文档:bricks_after_site_wrapper

📄 原始资料  |  展开查看原始 JSON(bricks_after_site_wrapper.json){ “name”: “bricks_after_site_wrapper”, “kind”: “action”, “url”: “https://academy.bricksbuilder.io/developer/hooks/actions/bricks-after_site_wrapper/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks_after_site_wrapper”, “description”: …

📄 原始资料  |  展开查看原始 JSON(bricks_after_site_wrapper.json)
{
  "name": "bricks_after_site_wrapper",
  "kind": "action",
  "url": "https://academy.bricksbuilder.io/developer/hooks/actions/bricks-after_site_wrapper/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks_after_site_wrapper",
  "description": {
    "en": "Runs in footer.php after bricks_after_footer and before wp_footer() . In the builder, Bricks uses this hook to close the .brx-body wrapper. On the frontend, Bricks also uses this position for one page navigation output when that page setting is enabled.",
    "zh": "在 footer.php 中,于 bricks_after_footer 之后、wp_footer() 之前触发。在构建器中,Bricks 使用此钩子来关闭 .brx-body 包装器。在前端,当启用单页导航输出设置时,Bricks 也会在该位置输出单页导航内容。"
  },
  "example_usage": "add_action( 'bricks_after_site_wrapper', function() {\n    echo '</div><!-- .before-site-wrapper -->';\n} );"
}

前言

在 footer.php 中,于 bricks_after_footer 之后、wp_footer() 之前触发。在构建器中,Bricks 使用此钩子来关闭 .brx-body 包装器。在前端,当启用单页导航输出设置时,Bricks 也会在该位置输出单页导航内容。

用法

将代码加入子主题的 functions.php

add_action( 'bricks_after_site_wrapper', function() {
    echo '
'; } );

示例代码

官方示例用法

add_action( 'bricks_after_site_wrapper', function() {
    echo '
'; } );

补充说明

更多细节可参考 官方文档