Make WordPress Core

Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#16686 closed enhancement (fixed)

$user argument of get_edit_profile_url() should be optional

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

Description

It should default to the current user.

Attachments (2)

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

Download all attachments as: .zip

Change History (11)

#1 @nacin
16 years ago

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

@garyc40
16 years ago

get_edit_profile_url() defaults to current user

#2 @garyc40
16 years ago

  • Keywords has-patch added

#3 follow-up: @nacin
16 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
16 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
16 years ago

default user for get_dashboard_url() as well

#5 @nacin
16 years ago

Good call, that's a good approach.

#6 @nacin
13 years ago

  • Component General → Users
  • Milestone Future Release → 3.9

#7 @nacin
13 years ago

  • Owner set to nacin
  • Resolution → fixed
  • Status new → 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.


13 years ago

#9 @nacin
13 years ago

In 27265:

Fix undefined variable. see #16686.

Note: See TracTickets for help on using tickets.