has_image_size() WordPress Function
The has_image_size() function is used to check if an image size has been registered.
has_image_size( string $name ) #
Check if an image size exists.
Parameters
- $name
(string)(Required)The image size to check.
Return
(bool) True if the image size exists, false if not.
Source
File: wp-includes/media.php
function has_image_size( $name ) { $sizes = wp_get_additional_image_sizes(); return isset( $sizes[ $name ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |