{
  "name": "bricks/combined_search/user_ids",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-combined_search-user_ids/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/combined_search/user_ids",
  "description": {
    "en": "Filters the list of user IDs returned by the combined search logic (used in AJAX search filters targeting users). This allows you to include or exclude users from the search results after the initial search query has run.",
    "zh": "筛选由组合搜索逻辑（用于针对用户的 AJAX 搜索筛选器）返回的用户 ID 列表。允许你在初始搜索查询运行后，从搜索结果中包含或排除用户。"
  },
  "parameters": [
    {
      "name": "user_ids",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of found user IDs.",
        "zh": "已找到的用户 ID 数组。"
      }
    },
    {
      "name": "user_fields",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of user fields being searched (e.g., ['display_name', 'user_email'] ).",
        "zh": "正在被搜索的用户字段数组（例如 ['display_name', 'user_email']）。"
      }
    },
    {
      "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/user_ids', function( $user_ids, $user_fields, $meta_fields, $search_term, $filter_id, $query_id ) {\n    // Example: Exclude administrator (ID: 1) from search results\n    if ( ( $key = array_search( 1, $user_ids ) ) !== false ) {\n        unset( $user_ids[ $key ] );\n    }\n\n\n    return $user_ids;\n}, 10, 6 );"
}