From: jmslbam Date: Sun, 3 Mar 2013 16:20:12 +0000 (+0100) Subject: Using WP_CLI::warning X-Git-Tag: v0.9.0~37^2~18 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=798aeac310e0a4d175e1265f656e3c587a83956f;p=wvm%2Fwvm.git Using WP_CLI::warning --- diff --git a/php/commands/media.php b/php/commands/media.php index 67ac71d5..03808498 100644 --- a/php/commands/media.php +++ b/php/commands/media.php @@ -59,14 +59,14 @@ class Media_Command extends WP_CLI_Command { $image = get_post( $id ); if ( !$image || 'attachment' != $image->post_type || 'image/' != substr( $image->post_mime_type, 0, 6 ) ) { - WP_CLI::warning( "FAILED: {$image->post_title} - invalid image ID" ); + WP_CLI::warning( "{$image->post_title} - invalid image ID" ); return; } $fullsizepath = get_attached_file( $image->ID ); if ( false === $fullsizepath || !file_exists( $fullsizepath ) ) { - WP_CLI::warning( "FAILED: {$image->post_title} - Can't find it $fullsizepath" ); + WP_CLI::warning( "{$image->post_title} - Can't find it $fullsizepath" ); return; } @@ -118,12 +118,12 @@ class Media_Command extends WP_CLI_Command { $metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath ); if ( is_wp_error( $metadata ) ) { - WP_CLI::line( $metadata->get_error_message() ); + WP_CLI::warning( $metadata->get_error_message() ); return; } if ( empty( $metadata ) ) { - WP_CLI::line( 'Unknown failure reason.' ); + WP_CLI::warning( 'Unknown failure reason.' ); return; } wp_update_attachment_metadata( $image->ID, $metadata );