WordPress.org

Make WordPress Core

Ticket #20967: wp.getAuthors.diff

File wp.getAuthors.diff, 647 bytes (added by zimbelp, 3 years ago)

scope get_users call to only return authors

  • wp-includes/class-wp-xmlrpc-server.php

     
    21942194                do_action('xmlrpc_call', 'wp.getAuthors'); 
    21952195 
    21962196                $authors = array(); 
    2197                 foreach ( get_users( array( 'fields' => array('ID','user_login','display_name') ) ) as $user ) { 
     2197                foreach ( get_users( array( 'fields' => array('ID','user_login','display_name'), 'who' => 'authors' ) ) as $user ) { 
    21982198                        $authors[] = array( 
    21992199                                'user_id'       => $user->ID, 
    22002200                                'user_login'    => $user->user_login,