get_intermediate_image_sizes()
Gets the available intermediate image size names.
Return Return
(string[]) An array of image size names.
More Information 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 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 code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
In
the get_image_sizes()
example above – note that since WordPress 4.4 there is a new size – ‘medium_large’.Include that in the array on line 13 to prevent errors.
List available image sizes with width and height following
Expand full source codeCollapse full source code
Some examples of use of this function:
Expand full source codeCollapse full source code