[wp-trac] [WordPress Trac] #57083: wp_list_authors and WP Search Users

WordPress Trac noreply at wordpress.org
Fri Nov 11 23:57:06 UTC 2022


#57083: wp_list_authors and WP Search Users
---------------------------------------+------------------------------
 Reporter:  pabloeduardo               |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  Awaiting Review
Component:  Query                      |     Version:  6.1
 Severity:  normal                     |  Resolution:
 Keywords:  needs-patch needs-testing  |     Focuses:
---------------------------------------+------------------------------
Description changed by sabernhardt:

Old description:

> Apparently wp_list_authors is loading a depreciated wordpress class
> called WP Search Users, this class has now been replaced with WP Query
> Users but wp_list_authors keeps using WP Search Users.
>
> However the case wp list authors is only accepting some parameters,
> neither through array or through post accepted more parameter, meaning
> that something like this worked:
>
> {{{
> wp_list_authors('orderby=name&order=DESC');
> }}}
>
> but something like this did not:
>
> {{{
> wp_list_authors('orderby=name&order=ASC');
> }}}
>   or even
> {{{
> wp_list_authors('orderby=name&order=DESC&optioncount=1');
> }}}
>

> My original code wasn’t working because it was stated as follows:
>
> {{{
> $authors = str_replace( ', ', '<br>', wp_list_authors([
>                         'style'                 => 'none',
>                         'optioncount'   => 1,
>                         'echo'                  => 0
>                 ]) );
>                 echo $authors;
> }}}

New description:

 Apparently `wp_list_authors` is loading a deprecated WordPress class
 called WP Search Users, this class has now been replaced with WP Query
 Users but `wp_list_authors` keeps using WP Search Users.

 However the case wp list authors is only accepting some parameters,
 neither through array or through post accepted more parameter, meaning
 that something like this worked:

 {{{
 wp_list_authors('orderby=name&order=DESC');
 }}}

 but something like this did not:

 {{{
 wp_list_authors('orderby=name&order=ASC');
 }}}

 or even
 {{{
 wp_list_authors('orderby=name&order=DESC&optioncount=1');
 }}}


 My original code wasn’t working because it was stated as follows:

 {{{
 $authors = str_replace( ', ', '<br>', wp_list_authors([
                         'style'                 => 'none',
                         'optioncount'   => 1,
                         'echo'                  => 0
                 ]) );
                 echo $authors;
 }}}

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57083#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list