From 8949dc2a09152019d4ede3ecfcf07a3d59ec3fa6 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 21 Nov 2013 16:28:39 -0200 Subject: [PATCH] implement 'wp post generate --post_content=' --- php/commands/post.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/commands/post.php b/php/commands/post.php index ca9a156f..1f8f7100 100644 --- a/php/commands/post.php +++ b/php/commands/post.php @@ -268,7 +268,10 @@ class Post_Command extends \WP_CLI\CommandWithDBObject { * * [--post_date=] * : The date of the generated posts. Default: current date - * + * + * [--post_content=] + * : The content of the generated posts. Default: empty + * * [--max_depth=] * : For hierarchical post types, generate child posts down to a certain depth. Default: 1 * @@ -286,6 +289,7 @@ class Post_Command extends \WP_CLI\CommandWithDBObject { 'post_status' => 'publish', 'post_author' => false, 'post_date' => current_time( 'mysql' ), + 'post_content' => '', ); extract( array_merge( $defaults, $assoc_args ), EXTR_SKIP ); @@ -340,6 +344,7 @@ class Post_Command extends \WP_CLI\CommandWithDBObject { 'post_parent' => $current_parent, 'post_name' => "post-$i", 'post_date' => $post_date, + 'post_content' => $post_content, ); wp_insert_post( $args, true ); -- 2.11.0