WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 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: 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 11 years ago.
Patch for wp-includes/author-template.php

Download all attachments as: .zip

Change History (9)

#1 @flocsy
11 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

?

@flocsy
11 years ago

Patch for wp-includes/author-template.php

#2 @flocsy
11 years ago

  • Keywords has-patch 2nd-opinion added

#3 follow-up: @mrmist
11 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.

#4 in reply to: ↑ 3 @tomontoast
11 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');

#5 @westi
11 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.

#6 follow-up: @Denis-de-Bernardy
11 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.

#7 in reply to: ↑ 6 @ShaneF
11 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.

#8 @DrewAPicture
5 years ago

  • Milestone 2.8 deleted
Note: See TracTickets for help on using tickets.