{
  "name": "bricks/dynamic_data/render_tag",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-dynamic_data-render_tag/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/dynamic_data/render_tag",
  "description": {
    "en": "Filters the logic to resolve a single dynamic data tag to its value. This filter is called for each individual tag found in the content.",
    "zh": "Bricks 1.5 引入了新的 bricks/element/render 筛选器。该筛选器使你能够以编程方式实现自己的条件渲染逻辑。例如：根据用户角色限制高级内容。如果此筛选器内的条件不满足（即返回 false），Bricks 不会渲染当前元素。"
  },
  "parameters": [
    {
      "name": "tag",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The dynamic data tag string (without curly braces, e.g., post_title:fallback ).",
        "zh": "动态数据标签字符串（不含花括号，例如 post_title:fallback）。"
      }
    },
    {
      "name": "post",
      "type": "WP_Post",
      "type_zh": null,
      "description": {
        "en": "The post context.",
        "zh": "文章上下文。"
      }
    },
    {
      "name": "context",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The context where the tag is being rendered.",
        "zh": "标签被渲染所处的上下文。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/dynamic_data/render_tag', function( $tag, $post, $context ) {\n    // Implement a custom tag '{my_custom_tag}'\n    if ( $tag === 'my_custom_tag' ) {\n        return 'My Custom Value';\n    }\n\n\n    return $tag; // Return original tag to let other providers handle it\n}, 10, 3 );"
}