Skip to content

Commit a1a3636

Browse files
Coding Standards: Remove unreachable continue from WP_Theme_JSON::get_block_nodes().
The outer loop uses a similar check for `$include_node_paths_only` to continue early a few lines above, preventing this one from ever being reached. Follow-up to [59213]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60409 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 18749a4 commit a1a3636

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/wp-includes/class-wp-theme-json.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,6 +2781,7 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
27812781
if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'] ) ) {
27822782
foreach ( $theme_json['styles']['blocks'][ $name ]['elements'] as $element => $node ) {
27832783
$node_path = array( 'styles', 'blocks', $name, 'elements', $element );
2784+
27842785
if ( $include_node_paths_only ) {
27852786
$nodes[] = array(
27862787
'path' => $node_path,
@@ -2798,12 +2799,6 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
27982799
foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) {
27992800
if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) {
28002801
$node_path = array( 'styles', 'blocks', $name, 'elements', $element );
2801-
if ( $include_node_paths_only ) {
2802-
$nodes[] = array(
2803-
'path' => $node_path,
2804-
);
2805-
continue;
2806-
}
28072802

28082803
$nodes[] = array(
28092804
'path' => $node_path,

0 commit comments

Comments
 (0)