{
  "name": "bricks/builder/first_element_category",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-builder-first_element_category/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/builder/first_element_category",
  "description": {
    "en": "Filters the default expanded element category in the Bricks builder panel. This allows you to prioritize specific element categories based on the post type or ID being edited.",
    "zh": "筛选 Bricks 构建器面板中默认展开的元素类别。允许你根据正在编辑的文章类型或 ID 优先展示特定元素类别。"
  },
  "parameters": [
    {
      "name": "category",
      "type": "string|bool",
      "type_zh": null,
      "description": {
        "en": "The category name to expand by default (e.g., layout , basic , single ). Default is false .",
        "zh": "默认展开的类别名称（例如 layout、basic、single）。默认为 false。"
      }
    },
    {
      "name": "post_id",
      "type": "int",
      "type_zh": null,
      "description": {
        "en": "The ID of the post being edited.",
        "zh": "正在被编辑的文章 ID。"
      }
    },
    {
      "name": "post_type",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The post type of the post being edited.",
        "zh": "正在被编辑的文章的文章类型。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/builder/first_element_category', function( $category, $post_id, $post_type ) {\n    // Example: Expand 'woocommerce' category for product templates\n    if ( $post_type === 'product' ) {\n        return 'woocommerce';\n    }\n\n\n    return $category;\n}, 10, 3 );"
}