Editor: remove null coalescing operator from layout.

Replaces uses of null coalescing operator in [56698].

Props dmsnell, mukesh27.
See #59443.


git-svn-id: https://develop.svn.wordpress.org/trunk@56700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Isabel Brison 2023-09-26 06:53:26 +00:00
parent a3c6b4c634
commit 6a61084bec

View File

@ -549,7 +549,7 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
function wp_render_layout_support_flag( $block_content, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$block_supports_layout = block_has_support( $block_type, 'layout', false ) || block_has_support( $block_type, '__experimentalLayout', false );
$layout_from_parent = $block['attrs']['style']['layout']['selfStretch'] ?? null;
$layout_from_parent = isset( $block['attrs']['style']['layout']['selfStretch'] ) ? $block['attrs']['style']['layout']['selfStretch'] : null;
if ( ! $block_supports_layout && ! $layout_from_parent ) {
return $block_content;
@ -770,7 +770,7 @@ function wp_render_layout_support_flag( $block_content, $block ) {
* @var string|null
*/
$inner_block_wrapper_classes = null;
$first_chunk = $block['innerContent'][0] ?? null;
$first_chunk = isset( $block['innerContent'][0] ) ? $block['innerContent'][0] : null;
if ( is_string( $first_chunk ) && count( $block['innerContent'] ) > 1 ) {
$first_chunk_processor = new WP_HTML_Tag_Processor( $first_chunk );
while ( $first_chunk_processor->next_tag() ) {