Make WordPress Core

Opened 5 years ago

Last modified 2 years ago

#43633 new enhancement

Duplicate links to edit profile dropdown in toolbar

Reported by: danieltj's profile danieltj Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: has-patch needs-testing 2nd-opinion
Focuses: ui Cc:

Description

Within the mini user profile drop down in the toolbar (to the right), there are two links which direct the user to the edit profile page. Not only is this confusing, it's a poor user experience as some users may wish to have a link to their author archive instead to see what they've written.

I propose this is changed so there is a link to author archives and the edit profile page.

Attachments (6)

user-profile-dropdown.png (24.7 KB) - added by danieltj 5 years ago.
Example of the mini user profile drop down
43633.diff (579 bytes) - added by danieltj 5 years ago.
Replaces edit profile with view posts
43633.2.diff (926 bytes) - added by danieltj 5 years ago.
Refreshed the patch
43633.3.diff (1.2 KB) - added by sabernhardt 2 years ago.
combining duplicate profile links within dropdown menu
combined-profile-link.png (14.4 KB) - added by sabernhardt 2 years ago.
43633.4.diff (995 bytes) - added by sabernhardt 11 months ago.
43633.3 without adding aria-hidden

Download all attachments as: .zip

Change History (15)

@danieltj
5 years ago

Example of the mini user profile drop down

@danieltj
5 years ago

Replaces edit profile with view posts

#1 @danieltj
5 years ago

  • Keywords has-patch needs-testing added

Added the 43633.diff patch which changes the link from an edit profile link to a view posts link.

#3 follow-up: @swissspidy
5 years ago

You'd need to change the false !== $profile_url condition there as well.

#4 in reply to: ↑ 3 ; follow-up: @danieltj
5 years ago

  • Keywords needs-refresh added; needs-testing removed

Replying to swissspidy:

You'd need to change the false !== $profile_url condition there as well.

Thanks for the heads up, I think it's worth refreshing the patch anyway to change the name and username link to the archive page rather than removing the edit profile link as that makes more sense to leave as it is so there is a clear way to edit the profile.

#5 in reply to: ↑ 4 @netweb
5 years ago

Replying to danieltj:

Replying to swissspidy:

You'd need to change the false !== $profile_url condition there as well.

Thanks for the heads up, I think it's worth refreshing the patch anyway to change the name and username link to the archive page rather than removing the edit profile link as that makes more sense to leave as it is so there is a clear way to edit the profile.

I'd much rather see the first link become a "view profile" link rather thean the current "edit profile" link:

e.g. https://profiles.wordpress.org/danieltj/profile/

The second link as noted above should remain as is

e.g. https://profiles.wordpress.org/danieltj/profile/edit

Per the above examples, most users of a bbPress site will not have any posts so linking to a users posts, or post archive when they have no posts is not what we want to do for sites such as those that use bbPress.

@danieltj
5 years ago

Refreshed the patch

#6 @danieltj
5 years ago

  • Keywords needs-testing added; needs-refresh removed

I've refreshed the patch in 43633.2.diff and added a filter so that plugins and site owners can change the URL if they wish. I think this is the best course of action as it opens up the author archive but lets people change it to whatever they like by filtering it. Essentially just letting people choose where they want this additional link to go.

Can I get tests and thoughts on this please?

#7 follow-up: @netweb
5 years ago

I stand by what I wrote in comment:5, the primary purpose of the wp_admin_bar_my_account_menu() function is to add "My Account" items to the admin bar which are the user profile links, first the user profile #L291, and then, if it is not multisite #L266 the "Edit My Profile" link is added.

43633.2.diff changes multisite behaviour by changing the first link to link to a users post archive rather than the current link to the dashboard #L267, this is currently used I expect due to all of the multisite blog/site/network juggling complexities that are required to retrieve any user related content in multisite environments.

Also adding a filter as proposed in 43633.2.diff puts the onus on developers to opt-out of a what is a breaking change being introduced into WordPress and these types of change should be avoided.

#8 in reply to: ↑ 7 @danieltj
5 years ago

  • Keywords 2nd-opinion added

Replying to netweb:

I stand by what I wrote in comment:5, the primary purpose of the wp_admin_bar_my_account_menu() function is to add "My Account" items to the admin bar which are the user profile links, first the user profile #L291, and then, if it is not multisite #L266 the "Edit My Profile" link is added.

43633.2.diff changes multisite behaviour by changing the first link to link to a users post archive rather than the current link to the dashboard #L267, this is currently used I expect due to all of the multisite blog/site/network juggling complexities that are required to retrieve any user related content in multisite environments.

Also adding a filter as proposed in 43633.2.diff puts the onus on developers to opt-out of a what is a breaking change being introduced into WordPress and these types of change should be avoided.

How do we fix the issue of having two links to the same page though? As it stands, single-site installs have two links to the same place which isn't useful and is confusing. In 43633.2.diff, the ids are kept the same to ensure additional links are still added correctly to the toolbar, the link location has simply changed.

There is another way to the dashboard on multisites anyway on the left hand side, so access to these account pages isn't lost and still very accessible. The aim here is to change the fact we have two links going to the same page right next to each other. A much better use of toolbar UI would be to provide a link to somewhere that is hard to find.

Adding 2nd-opinion to get more thoughts on this.

@sabernhardt
2 years ago

combining duplicate profile links within dropdown menu

#9 @sabernhardt
2 years ago

Adding a link to the author archive page likely is more appropriate with a plugin.

However, combining the two links seems possible with something like 43633.3.diff.

  1. "Edit profile" is included within the 'user-info' link, with the display-name class to keep the same styling. That span also has an edit-profile-link class for plugin authors who might wish to change those styles.
  2. I don't think the username adds any value for screen reader users, so it has aria-hidden (if I'm wrong, that attribute can be removed).
Last edited 2 years ago by sabernhardt (previous) (diff)

@sabernhardt
11 months ago

43633.3 without adding aria-hidden

Note: See TracTickets for help on using tickets.