From d1e6faa7ce99e134cbc834f887ed1b7de9100835 Mon Sep 17 00:00:00 2001 From: jmslbam Date: Tue, 5 Mar 2013 20:26:36 +0100 Subject: [PATCH] Added @unlink and merged from upstream master --- php/commands/media.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/commands/media.php b/php/commands/media.php index 2b0fa663..b6b247c3 100644 --- a/php/commands/media.php +++ b/php/commands/media.php @@ -90,12 +90,12 @@ class Media_Command extends WP_CLI_Command { $files = array(); while ( $file = readdir( $dir ) ) { - + WP_CLI::print_value( $dir_path ); if ( !( strrpos( $file, $image_name ) === false ) ) { $thumbnail = explode( $image_name, $file ); $filename = $thumbnail[ 1 ]; - +//WP_CLI::print_value( $dir ); //If we got the original / full image if ( "" == $thumbnail[ 0 ] ) { $filetype = wp_check_filetype($file); @@ -110,7 +110,7 @@ class Media_Command extends WP_CLI_Command { $height = $sizes[1]; if ( is_numeric( $width ) && is_numeric( $height ) ) { WP_CLI::line( "Thumbnail: {$width} x {$height} was deleted." ); - @unlink( $dir_path['basedir'] . DIRECTORY_SEPARATOR . $image_name . $thumbnail_name . $thumbnail_ext ); + unlink( $dir_path['basedir'] . DIRECTORY_SEPARATOR . $image_name . $thumbnail_name . $thumbnail_ext ); } } } -- 2.11.0