Skip to content

Commit ef52380

Browse files
committed
Use shortened ternary
1 parent 3403a53 commit ef52380

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Post_Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,11 +741,11 @@ public function generate( $args, $assoc_args ) {
741741
$call_time = current_time( 'mysql' );
742742

743743
if ( false === $post_date_gmt ) {
744-
$post_date_gmt = $post_date ? $post_date : $call_time;
744+
$post_date_gmt = $post_date ?: $call_time;
745745
}
746746

747747
if ( false === $post_date ) {
748-
$post_date = $post_date_gmt ? $post_date_gmt : $call_time;
748+
$post_date = $post_date_gmt ?: $call_time;
749749
}
750750

751751
if ( ! post_type_exists( $post_type ) ) {
@@ -888,7 +888,7 @@ private function get_category_ids( $arg ) {
888888
}
889889
}
890890
// If no category ids found, return exploded array for compat with previous WP-CLI versions.
891-
return $category_ids ? $category_ids : $categories;
891+
return $category_ids ?: $categories;
892892
}
893893

894894
/**

0 commit comments

Comments
 (0)