Created
January 9, 2025 04:28
-
-
Save benpearson/1a9ddeb9463f06b1c8e4882d7cb3cb87 to your computer and use it in GitHub Desktop.
Wordpress: Filter the image sizes automatically generated when uploading an image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Filter the image sizes automatically generated when uploading an image. | |
function dt_remove_default_image_sizes($sizes) | |
{ | |
unset($sizes['thumbnail']); | |
// unset( $sizes['medium']); // medium image size is used by WP Media Library for thumbnails | |
unset($sizes['medium_large']); | |
unset($sizes['large']); | |
return $sizes; | |
} | |
// add_filter( 'intermediate_image_sizes_advanced', 'dt_remove_default_image_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment