WordPress.org

Make WordPress Core

Ticket #18947: 18947_3.patch

File 18947_3.patch, 1.2 KB (added by F J Kaiser, 7 years ago)

Removed code (belonging to some other ticket) that was accidently still in the patch.

  • wp-includes/media.php

     
    579579/**
    580580 * Get the available image sizes
    581581 * @since 3.0.0
     582 * @param bool $keys_only Whether to return only the keys or an assoc array of
     583 *                      image sizes with their associated size & crop values as sub array.
    582584 * @return array Returns a filtered array of image size strings
    583585 */
    584 function get_intermediate_image_sizes() {
     586function get_intermediate_image_sizes( $keys_only = true ) {
    585587        global $_wp_additional_image_sizes;
    586588        $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
     589        if ( ! $keys_only ) {
     590                foreach ( $image_sizes as $size ) {
     591                        $image_sizes[ $size ]['width']  = intval( get_option( "{$size}_size_w") );
     592                        $image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h") );
     593                        // Crop false per default if not set
     594                        $image_sizes[ $size ]['crop']   = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false;
     595                }
     596        }
    587597        if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
    588598                $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) );
    589599