Function Reference: geodir_total_listings_count

Summary

This function has not been documented yet.

Source File

geodir_total_listings_count() is located in geodirectory-functions/helper_functions.php [Line: 1233]

Source Code

function geodir_total_listings_count($post_type = false)
{
	global $wpdb;

	$count = 0;
	
	if ($post_type) {
		$count = $count + $wpdb->get_var("select count(post_id) from " . $wpdb->prefix . "geodir_" . $post_type . "_detail");
	} else {
		$all_postypes = geodir_get_posttypes();

		if (!empty($all_postypes)) {
			foreach ($all_postypes as $key) {
				$count = $count + $wpdb->get_var("select count(post_id) from " . $wpdb->prefix . "geodir_" . $key . "_detail");
			}
		}	
	}

	return $count;
}