[wp-trac] [WordPress Trac] #39787: wp_list_authors can be optimize

WordPress Trac noreply at wordpress.org
Sun Feb 5 01:52:56 UTC 2017


#39787: wp_list_authors can be optimize
-------------------------+-----------------------------
 Reporter:  alexufo      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 May be i don't understand but look at this line

 https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/author-
 template.php#L392

 {{{#!php
  392                    $author = get_userdata( $author_id );
 }}}


 Why we should call `get_userdata()`? At top we call `$authors = get_users(
 $query_args );` and can  return display_name and user_nicename in next
 foreach section without `get_userdata()`.

 And will be nice add filter by role. Because wp_list_authors means authors
 not subscribers or editors.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39787>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list