diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 02114cf4cc..31baf119ff 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -749,10 +749,10 @@ function get_dynamic_block_names() { * @return array Associative array of `$block_type_name => $position` pairs. */ function get_hooked_blocks( $name, $relative_position = '' ) { - $block_types = WP_Block_Type_Registry::get_instance()->get_all_registered(); + $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' ) || ! is_array( $block_type->block_hooks ) ) { + if ( ! ( $block_type instanceof WP_Block_Type ) || ! is_array( $block_type->block_hooks ) ) { continue; } foreach ( $block_type->block_hooks as $anchor_block_type => $position ) {