Make WordPress Core

Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#16686 closed enhancement (fixed)

$user argument of get_edit_profile_url() should be optional

Reported by: nacin's profile nacin Owned by: nacin's profile 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 14 years ago.
get_edit_profile_url() defaults to current user
16686.2.diff (2.8 KB) - added by garyc40 14 years ago.
default user for get_dashboard_url() as well

Download all attachments as: .zip

Change History (11)

#1 @nacin
14 years ago

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

@garyc40
14 years ago

get_edit_profile_url() defaults to current user

#2 @garyc40
14 years ago

  • Keywords has-patch added

#3 follow-up: @nacin
14 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().

#4 in reply to: ↑ 3 @garyc40
14 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.

@garyc40
14 years ago

default user for get_dashboard_url() as well

#5 @nacin
14 years ago

Good call, that's a good approach.

#6 @nacin
11 years ago

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

#7 @nacin
11 years 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.

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


11 years ago

#9 @nacin
11 years ago

In 27265:

Fix undefined variable. see #16686.

Note: See TracTickets for help on using tickets.