-
-
Save jpmarchand/8f44cb7b1307f524d406 to your computer and use it in GitHub Desktop.
Remove image sizes in WordPress. Source: http://www.wpmayor.com/remove-image-sizes-in-wordpress/
This file contains 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
<?php | |
function wpmayor_custom_image_sizes($sizes) { | |
$myimgsizes = array("image-in-post" => __("Image in Post"), "full" => __("Original size")); | |
return $myimgsizes; | |
} | |
add_filter('image_size_names_choose', 'wpmayor_custom_image_sizes'); |
This file contains 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
<?php | |
//* Remove image sizes in WordPress | |
function customprefix_remove_image_sizes($sizes) { | |
unset($sizes['medium']); | |
unset($sizes['large']); | |
unset($sizes['plugin-name-image-size']); | |
return $sizes; | |
} | |
add_filter('intermediate_image_sizes_advanced', 'customprefix_remove_image_sizes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment