WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9165 closed defect (bug) (wontfix)

wp_list_authors: exclude_admin doesn't work if user_login <> 'admin'

Reported by: flocsy Owned by:
Milestone: 2.8 Priority: low
Severity: minor Version: 2.7
Component: General Keywords:
Focuses: Cc:

Description

If admin's username (user_login) is changed (for security reasons), wp_list_authors doesn't exclude it.

Attachments (1)

author-template.php.patch (785 bytes) - added by flocsy 5 years ago.
Patch for wp-includes/author-template.php

Download all attachments as: .zip

Change History (8)

comment:1 flocsy5 years ago

I'd be happy to create a patch. The question is what would be the best whay to decide who's the admin?

Currently this is the SQL:

WHERE user_login <> 'admin'

Would it be OK to change this to:

WHERE ID <> 1

?

flocsy5 years ago

Patch for wp-includes/author-template.php

comment:2 flocsy5 years ago

  • Keywords has-patch 2nd-opinion added

comment:3 follow-up: mrmist5 years ago

It would really depend on what the exclude_admin is meant to do. If it literally excludes "admin" then it's working as designed. Otherwise if it is meant to exclude ALL admins then it should really be checking against admin like role membership, because there could be more than one admin not necessarily just ID = 1.

comment:4 in reply to: ↑ 3 tomontoast5 years ago

According to the Codex:

Exclude the 'admin' (login is admin) account from authors list.

So this function does work as intended. The question is whether that is the correct functionality. I think it would be better if the user can set which accounts to exclude like so:

wp_list_authors('exclude=admin,bob');

comment:5 westi5 years ago

  • Cc westi added
  • Keywords has-patch 2nd-opinion removed

This is a nice piece of history.

I guess the correct thing to do is to try and extra the use case that is required.

Do people really want to exclude particular active authors from the list.

Is the hide_empty parameter enough.

Removing has-patch because the current patch doesn't provide much of an improvement.

I would rather we deprecated this feature over something more useful.

comment:6 follow-up: Denis-de-Bernardy5 years ago

  • Keywords wp_list_authors exclude_admin removed

I'd say we remove the option or close as wontfix.

there are a few tickets related to retrieving users with a given role or cap, and there is not a chance they'll get fixed any time soon.

comment:7 in reply to: ↑ 6 ShaneF5 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Replying to Denis-de-Bernardy:

I'd say we remove the option or close as wontfix.

there are a few tickets related to retrieving users with a given role or cap, and there is not a chance they'll get fixed any time soon.

Ditto. Closing.

Note: See TracTickets for help on using tickets.