Changeset 2953106
- Timestamp:
- 08/14/2023 08:41:48 AM (12 months ago)
- Location:
- regenerate-thumbnails/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
regenerate-thumbnails/trunk/includes/class-regeneratethumbnails-regenerator.php
r2191622 r2953106 41 41 */ 42 42 public $skipped_thumbnails = array(); 43 44 45 46 47 48 49 50 51 43 52 44 53 /** … … 184 193 } 185 194 186 $ old_metadata = wp_get_attachment_metadata( $this->attachment->ID );195 $old_metadata = wp_get_attachment_metadata( $this->attachment->ID ); 187 196 188 197 if ( $args['only_regenerate_missing_thumbnails'] ) { … … 196 205 // Thumbnail sizes that existed were removed and need to be added back to the metadata. 197 206 foreach ( $this->skipped_thumbnails as $skipped_thumbnail ) { 198 if ( ! empty( $ old_metadata['sizes'][ $skipped_thumbnail ] ) ) {199 $new_metadata['sizes'][ $skipped_thumbnail ] = $ old_metadata['sizes'][ $skipped_thumbnail ];207 if ( ! empty( $old_metadata['sizes'][ $skipped_thumbnail ] ) ) { 208 $new_metadata['sizes'][ $skipped_thumbnail ] = $old_metadata['sizes'][ $skipped_thumbnail ]; 200 209 } 201 210 } … … 210 219 // Delete old sizes that are still in the metadata. 211 220 $intermediate_image_sizes = get_intermediate_image_sizes(); 212 foreach ( $ old_metadata['sizes'] as $old_size => $old_size_data ) {221 foreach ( $old_metadata['sizes'] as $old_size => $old_size_data ) { 213 222 if ( in_array( $old_size, $intermediate_image_sizes ) ) { 214 223 continue; … … 264 273 wp_delete_file( $wp_upload_dir . $file ); 265 274 } 266 } elseif ( ! empty( $ old_metadata ) && ! empty( $old_metadata['sizes'] ) && is_array( $old_metadata['sizes'] ) ) {275 } elseif ( ! empty( $old_metadata['sizes'] ) ) { 267 276 // If not deleting, rename any size conflicts to avoid them being lost if the file still exists. 268 foreach ( $ old_metadata['sizes'] as $old_size => $old_size_data ) {277 foreach ( $old_metadata['sizes'] as $old_size => $old_size_data ) { 269 278 if ( empty( $new_metadata['sizes'][ $old_size ] ) ) { 270 $new_metadata['sizes'][ $old_size ] = $ old_metadata['sizes'][ $old_size ];279 $new_metadata['sizes'][ $old_size ] = $old_metadata['sizes'][ $old_size ]; 271 280 continue; 272 281 } … … 314 323 } 315 324 316 $metadata = wp_get_attachment_metadata( $this->attachment->ID );325 $metadata = ; 317 326 318 327 // This is based on WP_Image_Editor_GD::multi_resize() and others. … … 345 354 $size_data['crop'] 346 355 ); 356 347 357 348 358 // The false check filters out thumbnails that would be larger than the fullsize image. -
regenerate-thumbnails/trunk/readme.txt
r2882117 r2953106 3 3 Tags: thumbnail, thumbnails, post thumbnail, post thumbnails 4 4 Requires at least: 4.7 5 Tested up to: 6. 25 Tested up to: 6. 6 6 Requires PHP: 5.2.4 7 Stable tag: 3.1. 57 Stable tag: 3.1. 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 73 73 == ChangeLog == 74 74 75 76 77 78 79 75 80 = Version 3.1.5 = 76 81 77 82 * Fix: Don't overwrite 'All X Attachment' button label with featured images count. 83 84 78 85 79 86 = Version 3.1.4 = -
regenerate-thumbnails/trunk/regenerate-thumbnails.php
r2489598 r2953106 6 6 Description: Regenerate the thumbnails for one or more of your image uploads. Useful when changing their sizes or your theme. 7 7 Plugin URI: https://alex.blog/wordpress-plugins/regenerate-thumbnails/ 8 Version: 3.1. 58 Version: 3.1. 9 9 Author: Alex Mills (Viper007Bond) 10 10 Author URI: https://alex.blog/ … … 41 41 * @var string 42 42 */ 43 public $version = '3.1. 5';43 public $version = '3.1.'; 44 44 45 45 /**
Note: See TracChangeset
for help on using the changeset viewer.