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.

git-svn-id: https://develop.svn.wordpress.org/trunk@57383 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella 2024-01-30 11:08:15 +00:00
parent b57c822afd
commit 5466d3a9a7

View File

@ -837,7 +837,8 @@ function wp_render_layout_support_flag( $block_content, $block ) {
break;
}
if ( false !== strpos( $processor->get_attribute( 'class' ), $inner_block_wrapper_classes ) ) {
$class_attribute = $processor->get_attribute( 'class' );
if ( is_string( $class_attribute ) && str_contains( $class_attribute, $inner_block_wrapper_classes ) ) {
break;
}
} while ( $processor->next_tag() );