Make WordPress Core

Changeset 57383


Ignore:
Timestamp:
01/30/2024 11:08:15 AM (8 months ago)
Author:
youknowriad
Message:

Editor: Fix PHP warning in Layout block support.

strpos was triggering a php warning.
This also updates the code to use the now supported str_contains.

Props get_dave, dmsnell, ocean90, mukesh27.
Fixes #60327.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/layout.php

    r57328 r57383  
    838838        }
    839839
    840         if ( false !== strpos( $processor->get_attribute( 'class' ), $inner_block_wrapper_classes ) ) {
     840        $class_attribute = $processor->get_attribute( 'class' );
     841        if ( is_string( $class_attribute ) && str_contains( $class_attribute, $inner_block_wrapper_classes ) ) {
    841842            break;
    842843        }
Note: See TracChangeset for help on using the changeset viewer.