Skip to content

Commit

Permalink
fix: get_allowed_block_types() can return bool (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine authored Mar 27, 2024
1 parent 0c8e2c7 commit 05b21b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-ties-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

fix: Update parameter type for `$supported_blocks_for_post_type_context` in `wpgraphql_content_blocks_should_apply_post_type_editor_blocks_interfaces` to support boolean values
2 changes: 1 addition & 1 deletion includes/Registry/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function get_block_context_interfaces( string $block_name ): array {
* @param \WP_Block_Editor_Context $block_editor_context The context of the Block Editor
* @param \WP_Post_Type $post_type The Post Type an Interface might be applied to the block for
* @param array $all_registered_blocks Array of all registered blocks
* @param array $supported_blocks_for_post_type_context Array of all supported blocks for the context
* @param array|bool $supported_blocks_for_post_type_context Array of all supported blocks for the context
* @param array $block_and_graphql_enabled_post_types Array of Post Types that have block editor and GraphQL support
*/
$should_apply_post_type_editor_block_interface = apply_filters( 'wpgraphql_content_blocks_should_apply_post_type_editor_blocks_interfaces', true, $block_name, $block_editor_context, $post_type, $all_registered_blocks, $supported_blocks_for_post_type_context, $block_and_graphql_enabled_post_types );
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ parameters:
count: 1
path: includes/Field/BlockSupports/Anchor.php

-
message: "#^@param array \\$supported_blocks_for_post_type_context does not accept actual type of parameter\\: array\\<string\\>\\|bool\\.$#"
count: 1
path: includes/Registry/Registry.php

-
message: "#^Parameter \\#2 \\$block_spec of static method WPGraphQL\\\\ContentBlocks\\\\Field\\\\BlockSupports\\\\Anchor\\:\\:get_block_attributes_interfaces\\(\\) expects WP_Block_Type, WP_Block_Type\\|null given\\.$#"
count: 1
Expand Down

0 comments on commit 05b21b5

Please sign in to comment.