WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#18808 closed defect (bug) (fixed)

wp_lostpassword_url should be applied instead of using site_url

Reported by: markoheijnen Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: normal Version: 2.7.1
Component: Users Keywords: has-patch dev-feedback
Focuses: Cc:

Description

At this moment there are several places where the following code is been used:

site_url('wp-login.php?action=lostpassword', 'login')

It would be better to change that to wp_lostpassword_url. I created a patch what does that.
Only in wp-login I left two lines open: form and error handling.

I also changed wp_lostpassword_url so it can used within networks. The if/else statement can be removed when always using network_site_url. Also added some spacing.

Related ticket is: #9932

Attachments (2)

18808-lostpassword.diff (6.1 KB) - added by markoheijnen 10 years ago.
First version of the patch
18808-lostpassword2.diff (6.0 KB) - added by markoheijnen 10 years ago.

Download all attachments as: .zip

Change History (7)

@markoheijnen
10 years ago

First version of the patch

#1 @markoheijnen
10 years ago

  • Keywords has-patch dev-feedback added

#2 follow-up: @nacin
10 years ago

  • Milestone changed from Awaiting Review to 3.3
  • Type changed from enhancement to defect (bug)

I didn't know we had wp_lostpassword_url(). Not using our own API, that's lame.

We can always use network_site_url(), no need for an if statement. If not multisite, it simply calls site_url().

#3 @markoheijnen
10 years ago

I also didn't knew but needed to overwrite it to send it to a page instead.
That is also why I left two line open in wp-login.php

Update the patch to always use network_site_url()

#4 @nacin
10 years ago

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

In [19027]:

Use wp_lostpassword_url() instead of site_url(wp-login...). Update wp_lostpassword_url() to use network_site_url(). props markoheijnen, fixes #18808.

#5 in reply to: ↑ 2 @ramiy
10 years ago

Replying to nacin:

I didn't know we had wp_lostpassword_url().

The wp_lostpassword_url() functions exists since 2.8, check #9932 ticket.

Note: See TracTickets for help on using tickets.