remove_image_size( string $name )
Remove a new image size.
Description Description
Parameters Parameters
- $name
-
(string) (Required) The image size to remove.
Return Return
(bool) True if the image size was successfully removed, false on failure.
Source 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; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
To remove all the image sizes keeping only the default WordPress image sizes –
Example
In a theme’s functions.php file:
You could combine this with the add_image_size function in your theme.
To replace any of the default image sizes like ‘medium’, ‘large’, etc you must remove first and then add with new attributes.