WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19146 closed defect (bug) (fixed)

Remove $user_identity global usage in admin-bar.php

Reported by: duck_ Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

Used by the "My Account" menu, see [16077], the $user_identity global is back compat / 'deprecated' and we shouldn't use it, especially when we now have the full $current_user object via wp_get_current_user() anyway.

See [3566] for "Setup global user vars. Used by set_current_user() for back compat."

Patch also makes use the local $user_id variable instead of re-calling get_current_user_id() again.

Attachments (2)

19146.diff (1.1 KB) - added by duck_ 2 years ago.
19146.2.diff (1.5 KB) - added by duck_ 2 years ago.

Download all attachments as: .zip

Change History (4)

duck_2 years ago

duck_2 years ago

comment:1 nacin2 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [19284]:

Don't use $user_identity global. props duck_. fixes #19146.

comment:2 nacin2 years ago

  • Milestone changed from Awaiting Review to 3.3
Note: See TracTickets for help on using tickets.