{
  "name": "bricks/builder/supported_post_types",
  "kind": "filter",
  "url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-builder-supported_post_types/",
  "scraped_at": "2026-08-29",
  "hook_name": "bricks/builder/supported_post_types",
  "description": {
    "en": "Filters the list of post types that are enabled for editing with Bricks. This checks whether the builder should load for the current post type.",
    "zh": "筛选启用 Bricks 编辑的文章类型列表。用于检查构建器是否应加载当前文章类型。"
  },
  "parameters": [
    {
      "name": "supported_post_types",
      "type": "array",
      "type_zh": null,
      "description": {
        "en": "Array of supported post type slugs (e.g., ['page', 'post', 'my_cpt'] ).",
        "zh": "支持的文章类型 slug 数组（例如 ['page', 'post', 'my_cpt']）。"
      }
    },
    {
      "name": "current_post_type",
      "type": "string",
      "type_zh": null,
      "description": {
        "en": "The post type of the post being accessed.",
        "zh": "正在被访问的文章的文章类型。"
      }
    }
  ],
  "example_usage": "add_filter( 'bricks/builder/supported_post_types', function( $supported_post_types, $current_post_type ) {\n    // Example: Always allow 'my_custom_post_type' to be edited with Bricks\n    if ( $current_post_type === 'my_custom_post_type' && ! in_array( 'my_custom_post_type', $supported_post_types ) ) {\n        $supported_post_types[] = 'my_custom_post_type';\n    }\n\n\n    return $supported_post_types;\n}, 10, 2 );"
}