Ticket #2027: nothumb.diff

File nothumb.diff, 1.5 KB (added by skeltoac, 6 years ago)
  • wp-admin/inline-uploading.php

     
    55if (!current_user_can('edit_posts')) 
    66        die(__('You do not have permission to edit posts.')); 
    77 
    8 $wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment'); 
     8$wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment', 'thumbnail'); 
    99 
    1010for ($i=0; $i<count($wpvarstoreset); $i += 1) { 
    1111        $wpvar = $wpvarstoreset[$i]; 
     
    8383 
    8484        add_post_meta($id, '_wp_attachment_metadata', $imagedata); 
    8585 
    86         if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) { 
     86        if ( $thumbnail && ($imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024) ) { 
    8787                if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 ) 
    8888                        $error = wp_create_thumbnail($file, 128); 
    8989                elseif ( $imagedata['height'] > 96 ) 
     
    548548<input type="hidden" name="action" value="save" /> 
    549549<input type="hidden" name="post" value="<?php echo $post; ?>" /> 
    550550<input type="hidden" name="all" value="<?php echo $all; ?>" /> 
     551<label for="thumbnail"><?php _e('Create Thumbnail'); ?><input type="checkbox" name="thumbnail" id="thumbnail" value="1" /></label> 
    551552<input type="submit" value="<?php _e('Upload'); ?>" /> 
    552553<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" /> 
    553554</td>