[wp-trac] [WordPress Trac] #60071: wp_list_authors with exclude_admin=true does not exclude administrators
WordPress Trac
noreply at wordpress.org
Thu Dec 14 12:29:10 UTC 2023
#60071: wp_list_authors with exclude_admin=true does not exclude administrators
--------------------------+-----------------------------
Reporter: juliobox | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hi there.
In wp_list_authors() you can find this :
{{{#!php
<?php
if ( $parsed_args['exclude_admin'] && 'admin' === $author->display_name )
{
}}}
It's an old function (since 1.2) so it should be correctly done doing
this:
{{{#!php
<?php
if ( $parsed_args['exclude_admin'] && in_array( 'administrator', (array)
$author->roles ) ) {
}}}
Thanks
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60071>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list