Bricks 中文文档:bricks/render_footer

📄 原始资料  |  展开查看原始 JSON(bricks-render_footer.json){ “name”: “bricks/render_footer”, “kind”: “filter”, “url”: “https://academy.bricksbuilder.io/developer/hooks/filters/bricks-render_footer/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks/render_footer”, “description”: { “en”: “Filters the…

📄 原始资料  |  展开查看原始 JSON(bricks-render_footer.json)
{
  "name": "bricks/render_footer",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-render_footer/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/render_footer",
  "description": {
    "en": "Filters the rendered HTML of the Bricks footer template. This allows you to wrap the footer in custom markup or modify its output before it is echoed to the page.",
    "zh": "筛选 Bricks 页脚模板的渲染 HTML。允许你将页脚包装在自定义标记中或在将其回显到页面之前修改其输出。"
  },
  "parameters": [
    {
      "name": "footer_html",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The rendered HTML of the footer.",
        "zh": "已渲染的页脚 HTML。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/render_footer', function( $footer_html ) {\n    // Example: Wrap the footer in a custom container\n    return '<div class=\"custom-footer-wrapper\">' . $footer_html . '</div>';\n} );"
}

前言

筛选 Bricks 页脚模板的渲染 HTML。允许你将页脚包装在自定义标记中或在将其回显到页面之前修改其输出。

用法

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

add_filter( 'bricks/render_footer', function( $footer_html ) {
    // Example: Wrap the footer in a custom container
    return '';
} );

参数

  • $footer_html (string):已渲染的页脚 HTML。

示例代码

筛选返回值

add_filter( 'bricks/render_footer', function( $footer_html ) {
    // Example: Wrap the footer in a custom container
    return '';
} );

根据条件短路返回原值

根据条件跳过或修改返回值:

add_filter( 'bricks/render_footer', function( $value, $footer_html ) {
    if ( is_admin() ) { return $value; }
    // TODO: custom logic here
    return $value;
} );

补充说明

更多细节可参考 官方文档