Skip to content

Commit

Permalink
Fix: use use_block_editor_for_post_type instead of `post_type_suppo…
Browse files Browse the repository at this point in the history
…rts`
  • Loading branch information
theodesp committed Oct 2, 2023
1 parent 54affda commit fc23abe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-files-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

Fix: use `use_block_editor_for_post_type` instead of `post_type_supports` when filtering the post types.
3 changes: 1 addition & 2 deletions includes/Utilities/WPHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ public static function get_supported_post_types(): array {
if ( empty( $block_editor_post_types ) || ! is_array( $block_editor_post_types ) ) {
return $supported_post_types;
}

// Iterate over the post types
foreach ( $block_editor_post_types as $block_editor_post_type ) {
// If the post type doesn't support the editor, it's not block-editor enabled
if ( ! post_type_supports( $block_editor_post_type->name, 'editor' ) ) {
if ( ! use_block_editor_for_post_type( $block_editor_post_type->name ) ) {
continue;
}

Expand Down

0 comments on commit fc23abe

Please sign in to comment.