Ticket #28277: image-edit.diff
| File image-edit.diff, 2.0 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/image-edit.php
32 32 $note = "<div class='updated'><p>$msg->msg</p></div>"; 33 33 } 34 34 35 $edit_custom_sizes = apply_filters('edit_custom_thumbnail_sizes', false); 36 35 37 ?> 36 38 <div class="imgedit-wrap"> 37 39 <div id="imgedit-panel-<?php echo $post_id; ?>"> … … 138 140 <label class="imgedit-label"> 139 141 <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" /> 140 142 <?php _e('All sizes except thumbnail'); ?></label> 143 144 <?php if($edit_custom_sizes) : ?> 145 <?php foreach(array_unique($edit_custom_sizes) as $label => $size) : ?> 146 <?php if(array_key_exists($size, $meta['sizes'])) : ?> 147 <label class="imgedit-label"> 148 <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="<?php _e($size); ?>" /> 149 <?php _e($label); ?></label> 150 <?php endif; ?> 151 <?php endforeach; ?> 152 <?php endif; ?> 153 141 154 </p> 142 155 </div> 143 156 … … 745 758 $meta['width'] = $size['width']; 746 759 $meta['height'] = $size['height']; 747 760 748 if ( $success && ('nothumb' == $target || 'all' == $target)) {761 if ( $success ) { 749 762 $sizes = get_intermediate_image_sizes(); 750 if ( 'nothumb' == $target ) 751 $sizes = array_diff( $sizes, array('thumbnail') ); 763 if ( 'nothumb' == $target || 'all' == $target ) { 764 if ( 'nothumb' == $target ) 765 $sizes = array_diff( $sizes, array('thumbnail') ); 766 } elseif ( 'thumbnail' !== $target ) { 767 $sizes = array_diff( $sizes, array($target) ); 768 } 752 769 } 753 770 754 771 $return->fw = $meta['width']; … … 756 773 } elseif ( 'thumbnail' == $target ) { 757 774 $sizes = array( 'thumbnail' ); 758 775 $success = $delete = $nocrop = true; 776 } else { 777 $sizes = array( $target ); 778 $success = $delete = true; 779 $nocrop = $_wp_additional_image_sizes[ $size ]['crop']; 759 780 } 760 781 761 782 if ( isset( $sizes ) ) {