Skip to content

Commit

Permalink
Fix || bug and use null coalescing instead
Browse files Browse the repository at this point in the history
  • Loading branch information
intentionally-left-nil committed Mar 11, 2021
1 parent e0530d2 commit ecfba02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class-shortcode-site-counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ private function get_total_views( $days) {
$start_date = $datetime->format('Y-m-d');
$sql = $wpdb->prepare("SELECT SUM(visitors) FROM {$wpdb->prefix}koko_analytics_site_stats s WHERE s.date >= %s", array( $start_date ) );
}
return $wpdb->get_var( $sql ) || 0;
return $wpdb->get_var( $sql ) ?? 0;
}
}

0 comments on commit ecfba02

Please sign in to comment.