Skip to content

Commit

Permalink
Add manual paging of results in swap-coauthors dry mode command
Browse files Browse the repository at this point in the history
Must manually page, as the query is otherwise expecting the posts to be
modified and no longer match (so it's always querying page 1).

Fixes #260
  • Loading branch information
nickdaugherty committed Apr 14, 2015
1 parent 20ec693 commit 583124b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions php/class-wp-cli.php
Expand Up @@ -503,6 +503,11 @@ public function swap_coauthors( $args, $assoc_args ) {
}
}

// In dry mode, we must manually advance the page
if ( $dry ) {
$query_args['paged']++;
}

$this->stop_the_insanity();

$posts = new WP_Query( $query_args );
Expand Down

0 comments on commit 583124b

Please sign in to comment.