{
  "name": "bricks/combined_search/term_ids",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-combined_search-term_ids/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/combined_search/term_ids",
  "description": {
    "en": "Filters the list of term IDs returned by the combined search logic (used in AJAX search filters targeting terms). This allows you to include or exclude terms from the search results after the initial search query has run.",
    "zh": "筛选由组合搜索逻辑（用于针对术语的 AJAX 搜索筛选器）返回的术语 ID 列表。允许你在初始搜索查询运行后，从搜索结果中包含或排除术语。"
  },
  "parameters": [
    {
      "name": "term_ids",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of found term IDs.",
        "zh": "已找到的术语 ID 数组。"
      }
    },
    {
      "name": "term_fields",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of term fields being searched (e.g., ['name', 'slug'] ).",
        "zh": "正在被搜索的术语字段数组（例如 ['name', 'slug']）。"
      }
    },
    {
      "name": "meta_fields",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of meta keys being searched.",
        "zh": "正在被搜索的 meta key 数组。"
      }
    },
    {
      "name": "search_term",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The search term entered by the user.",
        "zh": "用户输入的搜索词。"
      }
    },
    {
      "name": "filter_id",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The ID of the filter element initiating the search.",
        "zh": "发起搜索的筛选元素的 ID。"
      }
    },
    {
      "name": "query_id",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The ID of the query loop being filtered.",
        "zh": "正在被筛选的查询循环 ID。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/combined_search/term_ids', function( $term_ids, $term_fields, $meta_fields, $search_term, $filter_id, $query_id ) {\n    // Example: Exclude 'uncategorized' term (ID: 1) from search results\n    if ( ( $key = array_search( 1, $term_ids ) ) !== false ) {\n        unset( $term_ids[ $key ] );\n    }\n\n\n    return $term_ids;\n}, 10, 6 );"
}