wpsc_post_count()WPSCache 1.0

No Hooks.

Return

null. Nothing (null).

Usage

wpsc_post_count();

wpsc_post_count() code WPSCache 1.12.4

function wpsc_post_count() {
	global $wpdb;
	static $count;

	if ( isset( $count ) ) {
		return $count;
	}

	$post_type_list = wpsc_get_post_types();
	$count = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type IN ( $post_type_list ) AND post_status = 'publish'" );

	return $count;
}