OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
377ec88
)
Store post ids during `wp post generate`.
author
Mike Burns
<mgburns@bu.edu>
Fri, 3 Jan 2014 20:29:05 +0000
(15:29 -0500)
committer
Mike Burns
<mgburns@bu.edu>
Fri, 3 Jan 2014 20:29:05 +0000
(15:29 -0500)
Fixes --max_depth which was broken in
fe2be3169b
.
Closes #820.
php/commands/post.php
patch
|
blob
|
history
diff --git
a/php/commands/post.php
b/php/commands/post.php
index
3f93268
..
3d57cf2
100644
(file)
--- a/
php/commands/post.php
+++ b/
php/commands/post.php
@@
-316,6
+316,7
@@
class Post_Command extends \WP_CLI\CommandWithDBObject {
$notify = \WP_CLI\Utils\make_progress_bar( 'Generating posts', $count );
+ $post_ids = array();
$current_depth = 1;
$current_parent = 0;
@@
-347,7
+348,7
@@
class Post_Command extends \WP_CLI\CommandWithDBObject {
'post_content' => $post_content,
);
- wp_insert_post( $args, true );
+
$post_ids[$i] =
wp_insert_post( $args, true );
$notify->tick();
}