{
  "name": "bricks/filter_element/filtered_source",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-filter_element-filtered_source/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/filter_element/filtered_source",
  "description": {
    "en": "Filters the data retrieved from the index representing the available filter options and their counts based on the current query results.",
    "zh": "此筛选器允许你修改 Bricks 加载图标库时的默认设置。"
  },
  "parameters": [
    {
      "name": "filtered_source",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Associative array where keys are filter values and values are their respective counts (based on the current filtered query).",
        "zh": "关联数组，键为筛选值，值为对应的计数（基于当前筛选后的查询）。"
      }
    },
    {
      "name": "element",
      "type": "object",
      "type_zh": null,
      "description": {
        "en": "The filter element instance.",
        "zh": "筛选元素实例。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/filter_element/filtered_source', function( $filtered_source, $element ) {\n    // Example: Ensure a specific value is always present with a count of 0 if missing\n    if ( ! isset( $filtered_source['some_value'] ) ) {\n        $filtered_source['some_value'] = 0;\n    }\n\n\n    return $filtered_source;\n}, 10, 2 );"
}