Skip to content

Commit

Permalink
fix: updating output to reflect that the ID belongs to an Admin account.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiesshop committed Oct 18, 2024
1 parent 95b282a commit 1c62152
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/class-wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ public function create_author_terms_for_posts( $args, $assoc_args ) {
$nonexistent_user_id = $record->post_author;
$record->post_author = $author_trans[ $record->post_author ];
$author = $authors[ $record->post_author ];
WP_CLI::warning( sprintf( 'Must transfer posts from User ID: %d to Author ID: %d (%s)', $nonexistent_user_id, $author->ID, $author->user_nicename ) );
WP_CLI::warning( sprintf( 'Must transfer posts from User ID: %d to Admin ID: %d (%s)', $nonexistent_user_id, $author->ID, $author->user_nicename ) );
} else {
$author = get_user_by( 'id', $record->post_author );

if ( false === $author ) {
$author = $this->get_first_admin_user();
WP_CLI::warning( sprintf( 'Must transfer posts from User ID: %d to Author ID: %d (%s)', $record->post_author, $author->ID, $author->user_nicename ) );
WP_CLI::warning( sprintf( 'Must transfer posts from User ID: %d to Admin ID: %d (%s)', $record->post_author, $author->ID, $author->user_nicename ) );
$author_trans[ $record->post_author ] = $author->ID;
$record->post_author = $author->ID;
}
Expand Down

0 comments on commit 1c62152

Please sign in to comment.