Skip to content

Commit e95c360

Browse files
committed
Fix migrate authors query pagination
1 parent bb0c1cc commit e95c360

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inc/cli/class-migrate-command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function wp_authors( $args, $assoc_args ) : void {
9292
*/
9393
$posts = get_posts( [
9494
'posts_per_page' => $posts_per_page,
95-
'paged' => $paged,
95+
'paged' => $dry_run ? $paged : 1,
9696
'post_status' => 'any',
9797
'ignore_sticky_posts' => true,
9898
'suppress_filters' => false,
@@ -128,7 +128,9 @@ public function wp_authors( $args, $assoc_args ) : void {
128128
WP_CLI::line( sprintf( 'Processed %d posts, pausing for a breath...', $count ) );
129129
sleep( 2 );
130130

131-
$paged++;
131+
if ( $dry_run ) {
132+
$paged++;
133+
}
132134
} while ( count( $posts ) );
133135

134136
if ( true === $dry_run ) {

0 commit comments

Comments
 (0)