Skip to content

Commit 9be7d88

Browse files
committed
Fix comment recount output
1 parent a9761dc commit 9be7d88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Comment_Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,12 +672,12 @@ public function count( $args, $assoc_args ) {
672672
*/
673673
public function recount( $args ) {
674674
foreach ( $args as $id ) {
675-
wp_update_comment_count( $id );
676675
$post = get_post( $id );
677676
if ( $post ) {
677+
wp_update_comment_count( $id );
678678
WP_CLI::log( "Updated post {$post->ID} comment count to {$post->comment_count}." );
679679
} else {
680-
WP_CLI::warning( "Post {$post->ID} doesn't exist." );
680+
WP_CLI::warning( "Post {$id} doesn't exist." );
681681
}
682682
}
683683
}

0 commit comments

Comments
 (0)