WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/image size names choose

Description

The 'image_size_names_choose' filter allows modification of the list of image sizes that are available to administrators in the WordPress Media Library.

This is most commonly used to make custom image sizes available from selection in the WordPress admin.

Usage

The following will add a new image size option to the list of selectable sizes in the Media Library.

add_filter( 'image_size_names_choose', 'my_custom_sizes' );

function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'your-custom-size' => __('Your Custom Size Name'),
    ) );
}

Triggers

As of WordPress 3.8 this hook is applied in the following locations:

See Also

Related