[wp-trac] [WordPress Trac] #14405: New Conditional Template Tag: is_multi_author()

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 24 02:28:25 UTC 2010


#14405: New Conditional Template Tag: is_multi_author()
-------------------------+--------------------------------------------------
 Reporter:  iandstewart  |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Themes       |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------

Comment(by filosofo):

 I don't understand all the extra logic that you have there, the results of
 which don't seem to be used.

 Can't you just do something like the following?

 {{{
 function is_multi_author() {
    global $wpdb;
    return (bool) ( 1 < $wpdb->get_var("SELECT COUNT(DISTINCT(post_author))
 FROM $wpdb->posts WHERE post_type = 'post' AND " .
 get_private_posts_cap_sql( 'post' ) );
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14405#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list