has_image_size( string $name )
Check if an image size exists.
Description Description
Parameters Parameters
- $name
-
(string) (Required) The image size to check.
Return Return
(bool) True if the image size exists, false if not.
Source Source
File: wp-includes/media.php
function has_image_size( $name ) { $sizes = wp_get_additional_image_sizes(); return isset( $sizes[ $name ] ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
This function only checks for image sizes that are registered via the
add_image_size()
function, core image sizes, namely small, medium, medium_large and large, are not considered. Hence, checking for a core image size usinghas_image_size()
will always return FALSE.