I make a function to return int based on COUNT, but else if not working. Could I miss something?
function kv_get_task_count() {
global $wpdb;
if (filter_status('new')):
$count_post = (int) $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->prefix . 'posts
WHERE post_type ="screening"
AND post_status ="new"
' );
elseif (filter_status('pending_review')):
$count_post = (int) $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->prefix . 'posts
WHERE post_type ="screening"
AND post_status ="pending_review"
' );
else:
$count_post = (int) $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->prefix . 'posts
WHERE post_type ="screening"
AND post_status ="new"
OR post_status ="pending_review"
' );
endif;
return $count_post;
}