📄 原始资料 | 展开查看原始 JSON(bricks_before_site_wrapper.json){ “name”: “bricks_before_site_wrapper”, “kind”: “action”, “url”: “https://academy.bricksbuilder.io/developer/hooks/actions/bricks-before_site_wrapper/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks_before_site_wrapper”, “descriptio…
📄 原始资料 | 展开查看原始 JSON(bricks_before_site_wrapper.json)
{
"name": "bricks_before_site_wrapper",
"kind": "action",
"url": "https://academy.bricksbuilder.io/developer/hooks/actions/bricks-before_site_wrapper/",
"scraped_at": "2026-08-29",
"hook_name": "bricks_before_site_wrapper",
"description": {
"en": "Runs in header.php after bricks_body and before bricks_before_header . In the builder, Bricks uses this hook to open the .brx-body wrapper around the builder frame. On the frontend, it is a general position before the header render flow.",
"zh": "在 header.php 中,于 bricks_body 之后、bricks_before_header 之前触发。在构建器中,Bricks 使用此钩子来打开构建器框架外的 .brx-body 包装器。在前端,它是页头渲染流之前的一个通用位置。"
},
"example_usage": "add_action( 'bricks_before_site_wrapper', function() {\n echo '<div class=\"before-site-wrapper\">';\n} );"
}
前言
在 header.php 中,于 bricks_body 之后、bricks_before_header 之前触发。在构建器中,Bricks 使用此钩子来打开构建器框架外的 .brx-body 包装器。在前端,它是页头渲染流之前的一个通用位置。
用法
将代码加入子主题的 functions.php:
add_action( 'bricks_before_site_wrapper', function() {
echo '';
} );
示例代码
官方示例用法
add_action( 'bricks_before_site_wrapper', function() {
echo '';
} );
补充说明
更多细节可参考 官方文档。