Ticket #9902: 9902.2.diff

File 9902.2.diff, 1.6 KB (added by wojtek.szkutnik, 22 months ago)
  • wp-includes/author-template.php

     
    248248 * author's name.</li> 
    249249 * <li>exclude_admin (boolean) (true): Exclude the 'admin' user that is 
    250250 * installed bydefault.</li> 
     251 * <li>exclude (string) (false): Exlude a list of authors based on user_ID.</li>  
    251252 * <li>show_fullname (boolean) (false): Show their full names.</li> 
    252253 * <li>hide_empty (boolean) (true): Don't show authors without any posts.</li> 
    253254 * <li>feed (string) (''): If isn't empty, show links to author's feeds.</li> 
     
    273274                'optioncount' => false, 'exclude_admin' => true, 
    274275                'show_fullname' => false, 'hide_empty' => true, 
    275276                'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true, 
    276                 'style' => 'list', 'html' => true 
     277                'style' => 'list', 'html' => true, 'exclude' => false  
    277278        ); 
    278279 
    279280        $r = wp_parse_args( $args, $defaults ); 
     
    282283 
    283284        /** @todo Move select to get_authors(). */ 
    284285        $users = get_users_of_blog(); 
     286         
     287        if($exclude) 
     288                $exclude = explode(',',$exclude); 
     289        else 
     290                $exclude = array(); 
     291                 
    285292        $author_ids = array(); 
    286293        foreach ( (array) $users as $user ) 
    287                 $author_ids[] = $user->user_id; 
     294                if ( ! in_array( $user->user_id, $exclude, false ) ) 
     295                        $author_ids[] = $user->user_id; 
     296                         
    288297        if ( count($author_ids) > 0  ) { 
    289298                $author_ids = implode(',', $author_ids ); 
    290299                $authors = $wpdb->get_results( "SELECT ID, user_nicename from $wpdb->users WHERE ID IN($author_ids) " . ($exclude_admin ? "AND user_login <> 'admin' " : '') . "ORDER BY display_name" );