Make WordPress Core

Opened 7 years ago

Last modified 6 months ago

#39787 new enhancement

wp_list_authors can be optimize

Reported by: alexufo's profile alexufo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Users Keywords: has-patch dev-feedback has-unit-tests
Focuses: Cc:


May be i don't understand but look at this line

 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.

Attachments (1)

39787.diff (2.9 KB) - added by theskinnyghost 4 years ago.
function changes + unit tests

Download all attachments as: .zip

Change History (4)

#1 @Hareesh Pillai
5 years ago

  • Keywords needs-patch added

4 years ago

function changes + unit tests

#3 @theskinnyghost
4 years ago

  • Keywords has-patch dev-feedback has-unit-tests added; needs-patch removed


I hope I understood the filtering requirement correctly.


Note: See TracTickets for help on using tickets.