WordPress at a glance

has_image_size() WP 1.0

Check if an image size exists.

No Hooks.


true/false. True if the image size exists, false if not.


has_image_size( $name );
$name(string) (required)
The image size to check.

Code of has_image_size: wp-includes/media.php VER 4.9.8

function has_image_size( $name ) {
	$sizes = wp_get_additional_image_sizes();
	return isset( $sizes[ $name ] );

Related Functions

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
    Hello, !     Log In . Register