FriendlyWP
10/26/2013 - 1:39 AM

Display custom image sizes in Media uploader; insert custom image sizes into posts and pages

Display custom image sizes in Media uploader; insert custom image sizes into posts and pages

// Allows users to insert your custom image sizes via the Add Media button
// In this example, two custom image sizes are added to the defaults
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'thumb-narrow' => __('Narrow Thumbnail'),
        'thumb-wide' => __('Wide Thumbnail'),
    ) );
}