Checks if an image size exists.
Parameters
$name
stringrequired- The image size to check.
Source
* @since 3.9.0
*
* @param string $name The image size to check.
* @return bool True if the image size exists, false if not.
Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
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.In a theme’s functions.php file combined with
remove_image_size()
: