WordPress.org

Make WordPress Core

Ticket #23009: crop-bool.diff

File crop-bool.diff, 883 bytes (added by anatolbroder, 8 years ago)

Set image crop option to boolean

  • trunk/wp-admin/includes/image.php

     
    9292                        else
    9393                                $sizes[$s]['height'] = get_option( "{$s}_size_h" ); // For default sizes set in options
    9494                        if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
    95                                 $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
     95                                $sizes[$s]['crop'] = (bool) intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
    9696                        else
    97                                 $sizes[$s]['crop'] = get_option( "{$s}_crop" ); // For default sizes set in options
     97                                $sizes[$s]['crop'] = (bool) get_option( "{$s}_crop" ); // For default sizes set in options
    9898                }
    9999
    100100                $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );