WordPress.org

Make WordPress Core

Changeset 45541


Ignore:
Timestamp:
06/15/2019 05:16:27 PM (3 months ago)
Author:
azaozz
Message:

Media: fix support for arrays for the crop setting for registered image sub-sizes in wp_get_registered_image_subsizes().

See #40439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r45539 r45541  
    865865
    866866        if ( isset( $additional_sizes[ $size_name ]['crop'] ) ) {
    867             $size_data['crop'] = (bool) $additional_sizes[ $size_name ]['crop'];
     867            $size_data['crop'] = $additional_sizes[ $size_name ]['crop'];
    868868        } else {
    869             $size_data['crop'] = (bool) get_option( "{$size_name}_crop" );
     869            $size_data['crop'] = get_option( "{$size_name}_crop" );
     870        }
     871
     872        if ( ! is_array( $size_data['crop'] ) || empty( $size_data['crop'] ) ) {
     873            $size_data['crop'] = (bool) $size_data['crop'];
    870874        }
    871875
Note: See TracChangeset for help on using the changeset viewer.