{
  "name": "bricks/dynamic_data/format_value",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-dynamic_data-format_value/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/dynamic_data/format_value",
  "description": {
    "en": "Filters the final processed value of any dynamic data tag before it is rendered. This is a powerful filter that runs for every dynamic tag, allowing you to globally modify outputs based on context or tag name.",
    "zh": "筛选单个动态数据标签的图标。可用于为自定义标签设置自定义图标。"
  },
  "parameters": [
    {
      "name": "value",
      "type": "mixed",
      "type_zh": null,
      "description": {
        "en": "The processed value of the dynamic tag.",
        "zh": "动态标签的处理值。"
      }
    },
    {
      "name": "tag",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The dynamic data tag (e.g., post_title , my_custom_tag ).",
        "zh": "动态数据标签（例如 post_title、my_custom_tag）。"
      }
    },
    {
      "name": "post_id",
      "type": "int",
      "type_zh": null,
      "description": {
        "en": "The ID of the post context.",
        "zh": "文章上下文的 ID。"
      }
    },
    {
      "name": "filters",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of modifiers/arguments applied to the tag (e.g., ['fallback' => '...'] ).",
        "zh": "应用于标签的修饰符/参数数组（例如 ['fallback' => '...']）。"
      }
    },
    {
      "name": "context",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The context where the tag is being rendered (e.g., text , link , image , video , object , media ).",
        "zh": "标签被渲染所处的上下文（例如 text、link、image、video、object、media）。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/dynamic_data/format_value', function( $value, $tag, $post_id, $filters, $context ) {\n    // Example: Add a suffix to the post title when used in text context\n    if ( $tag === 'post_title' && $context === 'text' ) {\n        return $value . ' | My Site';\n    }\n\n\n    return $value;\n}, 10, 5 );"
}