Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_multi_author [ WordPress Function ]

is_multi_author ( No parameters )
Returns:
  • (bool) Whether or not we have more than one author
Defined at:



Does this site have more than one author

Checks to see if more than one author has published posts.

Source


<?php
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 count$rows ) ? 0;
        
wp_cache_set('is_multi_author'$is_multi_author'posts');
    }

    return 
apply_filters'is_multi_author', (bool) $is_multi_author );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics