Ignore sizes which = false
-
It appears all of media files have a weird meta quirk where they contain
$meta['sizes']['600x999999'] = false
Because of the way you check for a file to exist it actually looks like the file exists.
$meta_old_filename = $meta['sizes'][$size]['file']; $meta_old_filepath = trailingslashit( $directory ) . $meta_old_filename; if ( $force_rename || ( file_exists( $meta_old_filepath ) && ( ( !file_exists( $meta_new_filepath ) ) // returns true since the directory is there
This ends up adding a size with a filename, but no width or height and throws notices all over the place. I modified your plugin to look like the following
// plugins/media-file-renamer/media-file-renamer.php:898 foreach ( $meta['sizes'] as $size => $meta_size ) { if (!isset($meta['sizes'][$size]['file'])) { continue; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Ignore sizes which = false’ is closed to new replies.