Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #159 - ${PostType}EditorBlock Interfaces registered and implemented with different names #160

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/violet-phones-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

Interface Types are now registered with the Post Type's `graphql_single_name`, instead of the Post Type's `name`. Fixes a bug where invalid Types were registered.
2 changes: 1 addition & 1 deletion includes/Registry/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function( $post_type ) {
// For each Post type
foreach ( $supported_post_types as $post_type ) {
// Normalize the post type name
$type_name = WPGraphQLHelpers::format_type_name( $post_type->name );
$type_name = Utils::format_type_name( $post_type->graphql_single_name );

// retrieve a block_editor_context for the current post type
$block_editor_context = WPHelpers::get_block_editor_context( $type_name, $post_id-- );
Expand Down
Loading