Last active
March 10, 2022 12:52
-
-
Save codersantosh/44bc4028b69d7ff7bd81a63eb9425b46 to your computer and use it in GitHub Desktop.
Only allow original uploaded image and Remove all image sizes generated by WordPress.
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
| /*Remove all image sizes*/ | |
| function prefix_remove_image_sizes( $sizes ) { | |
| return array(); | |
| } | |
| add_action( 'intermediate_image_sizes_advanced', 'prefix_remove_image_sizes' ); | |
| /*Removed scaled image size (-scaled as suffix on image name)*/ | |
| add_filter( 'big_image_size_threshold', '__return_false' ); | |
| /*Removed rotated image size (-rotated as suffix on image name)*/ | |
| add_filter( 'wp_image_maybe_exif_rotate', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment