Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#11808 closed defect (bug) (fixed)

is_super_admin() should try to get missing user_id

Reported by: filosofo Owned by: ryan
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Role/Capability Keywords: has-patch commit
Focuses: multisite Cc:


If its user_id argument is missing, is_super_admin() should assume we want the current user's ID and try to get that before returning false.

Attachments (1)

is_super_admin-get_userid.diff (714 bytes) - added by filosofo 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 @filosofo6 years ago

To clarify, instead of checking the global $current_user directly is_super_admin() should rely on the current user API as the functions used are pluggable and thus they might not be setting $current_user in predictable ways.

comment:2 @Denis-de-Bernardy6 years ago

  • Keywords commit added; is_super_admin removed

Gets my vote.

comment:3 @filosofo6 years ago

Changed patch to use ! empty instead of isset since $current_user can get set to false instead of being an object.

comment:4 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.