W3cubDocs

/WordPress

get_intermediate_image_sizes()

Gets the available intermediate image size names.

Return

(string[]) An array of image size names.

More Information

Details of returned value.

var_dump( get_intermediate_image_sizes() );
  array(4) {
    [0]=>
    string(9) "thumbnail"
    [1]=>
    string(6) "medium"
    [2]=>
    string(12) "medium_large"
    [3]=>
    string(5) "large"
    [4]=>
    string(10) "custom-size"
  }

Source

File: wp-includes/media.php

function get_intermediate_image_sizes() {
	$default_sizes    = array( 'thumbnail', 'medium', 'medium_large', 'large' );
	$additional_sizes = wp_get_additional_image_sizes();

	if ( ! empty( $additional_sizes ) ) {
		$default_sizes = array_merge( $default_sizes, array_keys( $additional_sizes ) );
	}

	/**
	 * Filters the list of intermediate image sizes.
	 *
	 * @since 2.5.0
	 *
	 * @param string[] $default_sizes An array of intermediate image size names. Defaults
	 *                                are 'thumbnail', 'medium', 'medium_large', 'large'.
	 */
	return apply_filters( 'intermediate_image_sizes', $default_sizes );
}

Changelog

Version Description
3.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_intermediate_image_sizes