has_image_size

Advertisement

Summery Summery

Check if an image size exists.

Syntax Syntax

has_image_size( string $name )

Parameters Parameters

$name

(Required) The image size to check.

Return Return

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

Source Source

File: wp-includes/media.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.

Advertisement

Leave a Reply