Skip to content

Commit 24dec4a

Browse files
committed
fix #175
1 parent 7b00064 commit 24dec4a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Post_Command.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,11 @@ public function generate( $args, $assoc_args ) {
710710
$post_author = $user_fetcher->get_check( $post_author )->ID;
711711
}
712712

713-
if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'post_content' ) ) {
713+
if ( !empty( \WP_CLI\Utils\get_flag_value( $assoc_args, 'post_content' ) ) ) {
714+
WP_CLI::error( "The parameter `post_content` reads from STDIN." );
715+
}
716+
717+
if ( \WP_CLI\Entity\Utils::has_stdin() && \WP_CLI\Utils\get_flag_value( $assoc_args, 'post_content' ) ) {
714718
$post_content = file_get_contents( 'php://stdin' );
715719
}
716720

0 commit comments

Comments
 (0)