WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19425 closed defect (bug) (fixed)

Lower priorities on toolbar search and my account actions.

Reported by: koopersmith Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: Toolbar Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

In [19518], we altered the priorities of the search and my account toolbar actions. Some plugins may have been adding items to the my account menu at earlier priorities, which pushes the user info and log out links down in the my account menu.

Given the significance of these links, I would suggest shifting both search and my account to priority 0.

Attachments (7)

the-problem.png (43.1 KB) - added by koopersmith 2 years ago.
the-solution.diff (668 bytes) - added by koopersmith 2 years ago.
19425.2.diff (1.3 KB) - added by koopersmith 2 years ago.
19425.3.diff (4.1 KB) - added by koopersmith 2 years ago.
19425.diff (4.1 KB) - added by nacin 2 years ago.
19425.4.diff (5.7 KB) - added by koopersmith 2 years ago.
19425.5.diff (5.7 KB) - added by koopersmith 2 years ago.

Download all attachments as: .zip

Change History (23)

koopersmith2 years ago

koopersmith2 years ago

comment:1 koopersmith2 years ago

  • Component changed from General to Admin Bar
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.3
  • Version set to 3.3

comment:2 koopersmith2 years ago

Thinking this over, we only really care about the positioning of the submenu items within the my account menu. I suggest we use one function to add the my account submenu items (bound to priority 0), and two others to add the top level search and my account items.

comment:3 nacin2 years ago

Agree we have to do something here.

I had suggested 0 but now I'm wondering if 1 & 2 might make sense, in case a plugin has a particular use case. For example, a top-level "Log Out" button.

The main worry here is the submenu items, rather than the top-level items. Let's split the my-account submenu items into a separate function and make them priority 0, then stagger search and my-account at 2 and 4, respectively.

comment:4 nacin2 years ago

While looking into the history of this I found #19426.

Last edited 2 years ago by nacin (previous) (diff)

koopersmith2 years ago

comment:5 nacin2 years ago

19425.2.diff is clever, but see #19429.

comment:6 koopersmith2 years ago

Okay, so attachment:19425.2.diff is probably a little too sneaky. Try this one on for size.

koopersmith2 years ago

comment:7 nacin2 years ago

19425.3.diff: Noting that most of these changes are just un-indenting due to if ( ! $user_id ) return;. Yay for returning early.

comment:8 nacin2 years ago

  • Keywords commit needs-refresh added

Note that this will need refresh to work with #19429's renaming of my-account.

nacin2 years ago

comment:9 nacin2 years ago

  • Keywords needs-refresh removed

comment:10 johnbillion2 years ago

  • Cc johnbillion@… added

comment:11 follow-up: nacin2 years ago

Wondering if it would be worth moving user-info, edit-profile, and logout into a user-info-group, but adding logout much later, that way logout is consistently the last link of the first group. Sometimes people may want to add secondary items, other times primary items. It would be better if logout is not so lost.

comment:12 in reply to: ↑ 11 koopersmith2 years ago

Replying to nacin:

Wondering if it would be worth moving user-info, edit-profile, and logout into a user-info-group, but adding logout much later, that way logout is consistently the last link of the first group. Sometimes people may want to add secondary items, other times primary items. It would be better if logout is not so lost.

I agree, and then some. The user info section has been a perfect example for why we needed groups in the first place, and making it a defined (instead of default) group will keep the account menu more organized as we move forward.

As for a group name, user-actions has a lovely ring to it. :)

comment:13 ryan2 years ago

Okay.

comment:14 nacin2 years ago

  • Keywords dev-reviewed added

koopersmith2 years ago

koopersmith2 years ago

comment:15 koopersmith2 years ago

Updated for [19549].

comment:16 ryan2 years ago

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

In [19559]:

Introduce user-actions group and move profile and logout menu items to it and change priority. Props koopersmith. fixes #19425

Note: See TracTickets for help on using tickets.