From: jmslbam Date: Thu, 11 Jul 2013 18:54:56 +0000 (+0200) Subject: Fix notices no index featured_image X-Git-Tag: v0.11.0~41 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=83b03bfd3cd1f6200889246809cc95eed05bb25f;p=wvm%2Fwvm.git Fix notices no index featured_image --- diff --git a/php/commands/media.php b/php/commands/media.php index 3657d319..0f6db05b 100644 --- a/php/commands/media.php +++ b/php/commands/media.php @@ -123,13 +123,13 @@ class Media_Command extends WP_CLI_Command { update_post_meta( $success, '_wp_attachment_image_alt', $assoc_args['alt'] ); // Set as featured image, if --post_id and --featured_image are set - if ( !is_wp_error( $success ) && $assoc_args['post_id'] && $assoc_args['featured_image'] ) + if ( !is_wp_error( $success ) && $assoc_args['post_id'] && isset($assoc_args['featured_image']) ) update_post_meta( $assoc_args['post_id'], '_thumbnail_id', $success ); $attachment_success_text = ''; if ( $assoc_args['post_id'] ) { $attachment_success_text = " and attached to post {$assoc_args['post_id']}"; - if ( $assoc_args['featured_image'] ) + if ( isset($assoc_args['featured_image']) ) $attachment_success_text .= ' as featured image'; }