has_image_size( string $name )

Check if an image size exists.


Parameters Parameters

$name

(string) (Required) The image size to check.


Top ↑

Return Return

(bool) True if the image size exists, false if not.


Top ↑

Source Source

File: wp-includes/media.php

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


Top ↑

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.