From dc2626debc3974231ec0e95f13b7786e68eb089d Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Mon, 25 Sep 2023 20:46:35 +0200 Subject: [PATCH] Use isset instead of array_key_exists --- src/wp-includes/blocks.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 9767c6ef08f61..055b6846446b8 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -758,7 +758,7 @@ function get_hooked_blocks( $name ) { if ( $anchor_block_type !== $name ) { continue; } - if ( ! array_key_exists( $relative_position, $hooked_blocks ) ) { + if ( ! isset( $hooked_blocks[ $relative_position ] ) ) { $hooked_blocks[ $relative_position ] = array(); } $hooked_blocks[ $relative_position ][] = $block_type->name; @@ -805,7 +805,7 @@ function make_before_block_visitor( $context ) { $anchor_block_type = $parent['blockName']; $hooked_block_types = get_hooked_blocks( $anchor_block_type ); - if ( array_key_exists( $relative_position, $hooked_block_types ) ) { + if ( isset( $hooked_block_types[ $relative_position ] ) ) { $hooked_block_types = $hooked_block_types[ $relative_position ]; } else { $hooked_block_types = array(); @@ -832,7 +832,7 @@ function make_before_block_visitor( $context ) { $anchor_block_type = $block['blockName']; $hooked_block_types = get_hooked_blocks( $anchor_block_type ); - if ( array_key_exists( $relative_position, $hooked_block_types ) ) { + if ( isset( $hooked_block_types[ $relative_position ] ) ) { $hooked_block_types = $hooked_block_types[ $relative_position ]; } else { $hooked_block_types = array(); @@ -881,7 +881,7 @@ function make_after_block_visitor( $context ) { $anchor_block_type = $block['blockName']; $hooked_block_types = get_hooked_blocks( $anchor_block_type ); - if ( array_key_exists( $relative_position, $hooked_block_types ) ) { + if ( isset( $hooked_block_types[ $relative_position ] ) ) { $hooked_block_types = $hooked_block_types[ $relative_position ]; } else { $hooked_block_types = array(); @@ -899,7 +899,7 @@ function make_after_block_visitor( $context ) { $anchor_block_type = $parent['blockName']; $hooked_block_types = get_hooked_blocks( $anchor_block_type ); - if ( array_key_exists( $relative_position, $hooked_block_types ) ) { + if ( isset( $hooked_block_types[ $relative_position ] ) ) { $hooked_block_types = $hooked_block_types[ $relative_position ]; } else { $hooked_block_types = array();