WordPress at Your Fingertips

has_image_size() WP 1.0

Check if an image size exists.

No Hooks.

Return

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

Usage

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

Changelog

Since 3.9.0 Introduced.

Code of has_image_size() WP 5.8.1

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

Thumbnail (images)

Thumbnails

No comments
    Log In