WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#1090 closed defect (bug) (fixed)

list_author() parameter not being followed if admin account not called admin

Reported by: CanuckKev Owned by: ryan
Milestone: Priority: normal
Severity: minor Version: 1.5
Component: Template Keywords:
Focuses: Cc:

Description

The Codex lists the usage of the list_athor() tag as this:
< ?php list_authors(optioncount, exclude_admin,

show_fullname, hide_empty,
'feed', 'feed_image'); ? >

The "exclude admin" option will not exclude admin if you change the Nickname of the admin to anything else but admin. This should not be as it should only exclude the userlevel of 10 (that being the admin account).

Attachments (1)

template-functions-author.php.diff (861 bytes) - added by CanuckKev 9 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 CanuckKev9 years ago

  • Patch set to No

Use the tag as such:
< ?php list_authors(,TRUE,); ? >
And the admin will be excluded on the list. Now change the "Admin" Nickname to anything other than admin, and it appears in the author list.

comment:2 CanuckKev9 years ago

Sorry, tag should be list_authors()....

comment:3 Kafkaesqui9 years ago

"This should not be as it should only exclude the userlevel of 10 (that being the admin account)."

That would work only if the user level on one or more accounts has not been changed to 10 as well (through the db). I believe the possible best option is to exclude based on user login ('admin').

comment:4 CanuckKev9 years ago

Should there only be one level 10 admin? A level 9 user is capable of doing everything except assigne ownership of pages or posts to a level 10, and you can't upgrade a level 9 to 10 user via normal means.

comment:5 Kafkaesqui9 years ago

That's up to the devs to decide, as they'd need to find a way of limiting it. But I believe the goal with the 'exclude_admin' argument was to hide just the original admin account, and not all possible admins. That can be done by the login name or ID.

comment:6 MC_incubus9 years ago

  • Resolution changed from 10 to 70

Neither the login ('admin') nor the ID (1) nor the level (10) can be changed without hacking the database.

There's really no reason to change any of these things. Level 8 and 9 accounts have just as much access as the level 10 admin account. See here: http://codex.wordpress.org/User_Levels

comment:7 CanuckKev9 years ago

MC_incubus, I agree completely.

So does it not make sense to have the tag base it on Userlevel, and not an arbitrary name that can be changed causing the tag to not behave as intended?

comment:8 Kafkaesqui9 years ago

There's one thing you can't do at 9: edit posts created by the admin account.

'exclude_admin' runs into problems when tied to nickname, so it should be aimed at something unique and permanent; it's more likely the admin ID/login will go untouched than the user levels for other accounts.

comment:9 MC_incubus9 years ago

I'd go with user_login.

I'm submitting a patch that makes that change.

comment:10 MC_incubus9 years ago

  • Owner changed from anonymous to rboren
  • Status changed from new to assigned

comment:11 ryan9 years ago

  • fixed_in_version set to 1.5.1
  • Resolution changed from 70 to 20
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.