get_intermediate_image_sizes() WordPress Function
The get_intermediate_image_sizes() function is used to retrieve a list of all the intermediate image sizes that are available for use in Wordpress. This function can be useful for plugins and themes that need to know what image sizes are available for use.
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 ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |