Skip to content

Commit

Permalink
Fixed WP CLI create-terms-for-posts if no co-authors found
Browse files Browse the repository at this point in the history
Script was stopping after no co-authors was find. Now script will
display an error message and continue to the next post.
  • Loading branch information
Rebecca Hum committed May 30, 2017
1 parent 1387ae1 commit f759744
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php/class-wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function create_terms_for_posts() {

$terms = cap_get_coauthor_terms_for_post( $single_post->ID );
if ( empty( $terms ) ) {
WP_CLI::error( sprintf( 'No co-authors found for post #%d.', $single_post->ID ) );
WP_CLI::line( sprintf( 'No co-authors found for post #%d.', $single_post->ID ) );
continue;
}

if ( ! empty( $terms ) ) {
Expand Down

0 comments on commit f759744

Please sign in to comment.