zulhfreelancer
6/14/2015 - 9:09 PM

Remove Image Sizes Option in WordPress Media Upload Window

Remove Image Sizes Option in WordPress Media Upload Window

// ADD NEW IMAGE SIZE
add_action( 'after_setup_theme', 'baw_theme_setup' );
function baw_theme_setup() {
  add_image_size( 'full-post-width', 568 ); // 568 pixels wide (and unlimited height)
}

// REMOVE ALL IMAGE SIZES IN MEDIA UPLOADER WINDOW
function my_custom_image_sizes($sizes) {
   unset( $sizes['thumbnail']);
   unset( $sizes['medium']);
   unset( $sizes['large']);
   unset( $sizes['full'] );

   // add your image sizes, i.e.
   $myCustomImgsizes = array(
          "full-post-width" => __( "Full Post Width" )
   );
   $newimgsizes = array_merge($sizes, $myCustomImgsizes);
   return $newimgsizes;
}
add_filter('image_size_names_choose', 'my_custom_image_sizes');