apply_filters( 'image_size_names_choose', string[] $size_names )

Filters the names and labels of the default image sizes.



(string[]) Array of image size labels keyed by their name. Default values include 'Thumbnail', 'Medium', 'Large', and 'Full Size'.

Top ↑

More Information

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.

Top ↑


File: wp-admin/includes/media.php

View on Trac

Top ↑


Version Description
3.3.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Rami Yushuvaev

    Add a new image sizes to the Media Library .

    // Add images sizes.
    function custom_theme_setup() {
    	add_image_size( 'custom-size-1', 1200, 300, true );
    	add_image_size( 'custom-size-2', 1000, 333, true );
    add_action( 'after_setup_theme', 'custom_theme_setup' );
    // Make custom sizes selectable from WordPress admin.
    function custom_image_sizes( $size_names ) {
    	$new_sizes = array(
    		'custom-size-1' => __( 'Custom Size #1', '' ),
    		'custom-size-2' => __( 'Custom Size #2', '' ),
    	return array_merge( $size_names, $new_sizes );
    add_filter( 'image_size_names_choose', 'custom_image_sizes' );
  2. Skip to note 2 content
    Contributed by Steven Lin

    Example migrated from Codex:

    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'),
        ) );

You must log in before being able to contribute a note or feedback.