From bd1c57bb20c9b36e708c178a3b8f9c808ff5aa56 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 21 Sep 2023 12:09:13 +0200 Subject: [PATCH] Make unit tests pass --- src/wp-includes/blocks.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 567c2486490f2..b79e55378d6ab 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -751,6 +751,9 @@ function get_hooked_blocks( $name ) { $block_types = WP_Block_Type_Registry::get_instance()->get_all_registered(); $hooked_blocks = array(); foreach ( $block_types as $block_type ) { + if ( ! property_exists( $block_type, 'block_hooks' ) ) { + continue; + } foreach ( $block_type->block_hooks as $anchor_block_type => $relative_position ) { if ( $anchor_block_type === $name ) { $hooked_blocks[ $block_type->name ] = $relative_position;