OSDN Git Service

Merge pull request #912 from rodrigoprimo/undefined-variable
authorCristi Burcă <scribu@gmail.com>
Thu, 12 Dec 2013 15:02:02 +0000 (07:02 -0800)
committerCristi Burcă <scribu@gmail.com>
Thu, 12 Dec 2013 15:02:02 +0000 (07:02 -0800)
Fix undefined variable in 'wp post edit'

php/commands/post.php

index d90bc93..c72ddd8 100644 (file)
@@ -115,7 +115,7 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
        public function edit( $args, $_ ) {
                $post = $this->fetcher->get_check( $args[0] );
 
-               $r = $this->_edit( $post->post_content, "WP-CLI post $post_id" );
+               $r = $this->_edit( $post->post_content, "WP-CLI post {$post->ID}" );
 
                if ( $r === false )
                        \WP_CLI::warning( 'No change made to post content.', 'Aborted' );