{
  "name": "bricks/dynamic_data/text_separator",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-dynamic_data-text_separator/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/dynamic_data/text_separator",
  "description": {
    "en": "Filters the separator used when joining array values in a dynamic data tag (text context). The default separator is a comma and a space ( , ).",
    "zh": "通过此筛选器，可对元素执行自定义 PHP 逻辑，进而可以控制元素是否被渲染。"
  },
  "parameters": [
    {
      "name": "sep",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The separator string.",
        "zh": "分隔符字符串。"
      }
    },
    {
      "name": "tag",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The dynamic data tag.",
        "zh": "动态数据标签。"
      }
    },
    {
      "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 applied to the tag.",
        "zh": "应用于标签的修饰符数组。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/dynamic_data/text_separator', function( $sep, $tag, $post_id, $filters ) {\n    // Example: Use a line break separator for a specific custom field\n    if ( $tag === 'my_repeater_field' ) {\n        return '<br>';\n    }\n\n\n    return $sep;\n}, 10, 4 );"
}