WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/08/2010 08:51:12 AM (12 years ago)
Author:
westi
Message:

Introduce a single function for getting all the intermediate image sizes to be used both when adding attachements and deleting. Fixes #10263 props scribu.

File:
1 edited

Legend:

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

    r12524 r12659  
    505505    }
    506506    return $data;
     507}
     508
     509/**
     510 * Get the available image sizes
     511 * @since 3.0
     512 * @return array Returns a filtered array of image size strings
     513 */
     514function get_intermediate_image_sizes() {
     515    global $_wp_additional_image_sizes;
     516    $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
     517    if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
     518        $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) );
     519
     520    return apply_filters( 'intermediate_image_sizes', $image_sizes );
    507521}
    508522
Note: See TracChangeset for help on using the changeset viewer.