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