WordPress.org

Make WordPress Core

Changeset 52380


Ignore:
Timestamp:
12/15/2021 04:06:53 AM (5 weeks ago)
Author:
isabel_brison
Message:

Fix deprecated usage of passing null to explode()

As of PHP 8.1, explode() does not permit null as its second argument. This results in warnings being spat out on every page because of a usage of this in wp-includes/block-supports/layout.php.

See #53635.
Props noisysocks.

File:
1 edited

Legend:

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

    r52324 r52380  
    4747    $style = '';
    4848    if ( 'default' === $layout_type ) {
    49         $content_size = isset( $layout['contentSize'] ) ? $layout['contentSize'] : null;
    50         $wide_size    = isset( $layout['wideSize'] ) ? $layout['wideSize'] : null;
     49        $content_size = isset( $layout['contentSize'] ) ? $layout['contentSize'] : '';
     50        $wide_size    = isset( $layout['wideSize'] ) ? $layout['wideSize'] : '';
    5151
    5252        $all_max_width_value  = $content_size ? $content_size : $wide_size;
Note: See TracChangeset for help on using the changeset viewer.