WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 5 months ago

Last modified 5 months ago

#16686 closed enhancement (fixed)

$user argument of get_edit_profile_url() should be optional

Reported by: nacin Owned by: nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.1
Component: Users Keywords: has-patch
Focuses: Cc:

Description

It should default to the current user.

Attachments (2)

16686.diff (1.2 KB) - added by garyc40 3 years ago.
get_edit_profile_url() defaults to current user
16686.2.diff (2.8 KB) - added by garyc40 3 years ago.
default user for get_dashboard_url() as well

Download all attachments as: .zip

Change History (11)

comment:1 nacin3 years ago

And it should be renamed from $user to $user_id, for clarity. Generally $user is a WP_User object.

garyc403 years ago

get_edit_profile_url() defaults to current user

comment:2 garyc403 years ago

  • Keywords has-patch added

comment:3 follow-up: nacin3 years ago

Looking at it further, the same treatment can probably be applied to get_dashboard_url(), in fact we can just put the logic there, and pass $user_id = 0 right into get_dashboard_url().

comment:4 in reply to: ↑ 3 garyc403 years ago

Replying to nacin:

in fact we can just put the logic there, and pass $user_id = 0 right into get_dashboard_url().

That is possible, but the $user_id passed into edit_profile_url filter would be 0 instead of an actual ID.

garyc403 years ago

default user for get_dashboard_url() as well

comment:5 nacin3 years ago

Good call, that's a good approach.

comment:6 nacin6 months ago

  • Component changed from General to Users
  • Milestone changed from Future Release to 3.9

comment:7 nacin5 months ago

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

In 27260:

Make the user arguments for get_edit_profile_url() and get_dashboard_url() optional, defaulting to the current user.

props garyc40.
fixes #16686.

comment:8 ircbot5 months ago

This ticket was mentioned in IRC in #wordpress-dev by svn-b42. View the logs.

comment:9 nacin5 months ago

In 27265:

Fix undefined variable. see #16686.

Note: See TracTickets for help on using tickets.