Advertisements

is_multi_author

Definition:
function is_multi_author() {}

Does this site have more than one author
Checks to see if more than one author has published posts.

Return values

returns:Whether or not we have more than one author

Defined filters

  • is_multi_author
    apply_filters( 'is_multi_author', (bool)

Source code

function is_multi_author() {

	global $wpdb;



	if ( false === ( $is_multi_author = wp_cache_get('is_multi_author', 'posts') ) ) {

		$rows = (array) $wpdb->get_col("SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2");

		$is_multi_author = 1 < count( $rows ) ? 1 : 0;

		wp_cache_set('is_multi_author', $is_multi_author, 'posts');

	}



	return apply_filters( 'is_multi_author', (bool) $is_multi_author );

}

14208

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: