W3cubDocs

/WordPress

remove_image_size( string $name )

Remove a new image size.

Description

Parameters

$name

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

Return

(bool) True if the image size was successfully removed, false on failure.

Source

File: wp-includes/media.php

function remove_image_size( $name ) {
	global $_wp_additional_image_sizes;

	if ( isset( $_wp_additional_image_sizes[ $name ] ) ) {
		unset( $_wp_additional_image_sizes[ $name ] );
		return true;
	}

	return false;
}

Changelog

Version Description
3.9.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_image_size