Skip to content

Instantly share code, notes, and snippets.

@smartdeal
Created May 13, 2018 16:06
Show Gist options
  • Save smartdeal/bb8c39795a70bb244c3a357c1881bc39 to your computer and use it in GitHub Desktop.
Save smartdeal/bb8c39795a70bb244c3a357c1881bc39 to your computer and use it in GitHub Desktop.
[Remove default image sizes] #WP #WP_functions
/wp-admin/options.php
medium_large_size_w
function dco_remove_default_image_sizes( $sizes) {
return array_diff( $sizes, array(
'thumbnail',
'medium',
'medium_large',
'large',
) );
}
add_filter('intermediate_image_sizes', 'dco_remove_default_image_sizes');
add_action('after_setup_theme', function() {
echo '<pre>';
print_r(wp_get_additional_image_sizes());
echo '</pre>';
die();
}, 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment