diff --git a/tools/av-bricks-rest-bridge.php b/tools/av-bricks-rest-bridge.php index e581ea6..8987e79 100644 --- a/tools/av-bricks-rest-bridge.php +++ b/tools/av-bricks-rest-bridge.php @@ -29,10 +29,16 @@ add_filter('register_post_type_args', function ($args, $post_type) { $args['show_in_rest'] = true; $args['rest_base'] = $post_type === 'bricks_template' ? 'bricks_template' : ($post_type . 's'); $args['rest_controller_class'] = 'WP_REST_Posts_Controller'; - $args['supports'] = array_unique(array_merge( - $args['supports'] ?? [], - ['title', 'editor', 'author', 'custom-fields'] // custom-fields needed so /wp/v2/ exposes the `meta` field - )); + + // Only ADD 'custom-fields' (required so /wp/v2/ exposes the meta field). + // Do NOT add 'editor' or override the whole supports array — that breaks the + // Bricks builder for bricks_template (Bricks's CPT supports = author/revisions/ + // thumbnail/title — no 'editor', deliberately). + $existing_supports = $args['supports'] ?? []; + if (! in_array('custom-fields', $existing_supports, true)) { + $existing_supports[] = 'custom-fields'; + } + $args['supports'] = $existing_supports; return $args; }, 10, 2);