Ticket #18947: 18947_3.patch
File 18947_3.patch, 1.2 KB (added by , 13 years ago) |
---|
-
wp-includes/media.php
579 579 /** 580 580 * Get the available image sizes 581 581 * @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. 582 584 * @return array Returns a filtered array of image size strings 583 585 */ 584 function get_intermediate_image_sizes( ) {586 function get_intermediate_image_sizes( $keys_only = true ) { 585 587 global $_wp_additional_image_sizes; 586 588 $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 } 587 597 if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) 588 598 $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) ); 589 599