WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#10141 closed enhancement (duplicate)

URL Functions for: login, logout, lostpasword and the new register

Reported by: ramiy Owned by: ramiy
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Template Keywords: has-patch
Focuses: Cc:
PR Number:

Description

I want to finish the work i started on #9932.

First i complited the set of "wp_*_url()" functions:

wp_login_url($redirect) - exists

wp_logout_url($redirect) - exists

wp_lostpassword_url($redirect) - exists

wp_registration_url($redirect) - NEW !!!

Then i examind the wp_loginout($redirect) function and the wp_register( $before = '<li>', $after = '</li>' ) function.

The old wp_register( $before = '<li>', $after = '</li>' ) was depricated in favor of the new wp_registration($redirect), and moved to <wp-includes/deprecated.php>.

The new wp_registration() function uses wp_registration_url(), and like all the functions in this set it accepts only the $redirect parameter.

At the end i fixed <wp-includes/default-widgets.php> and <wp-content/themes/default/sidebar.php> to use the new wp_registration() function.

(Sorry for the bad english)

Attachments (1)

registration.patch (6.1 KB) - added by ramiy 10 years ago.

Download all attachments as: .zip

Change History (18)

@ramiy
10 years ago

#1 @ramiy
10 years ago

  • Keywords has-patch added

#2 @Denis-de-Bernardy
10 years ago

  • Milestone changed from 2.8.1 to 2.9

enhancement

#3 @westi
10 years ago

  • Milestone changed from 2.9 to Future Release

Not sure this is necessary moving to Future for now.

#4 @ramiy
10 years ago

  • Milestone changed from Future Release to 2.9

Why not?

This way all the url_functions for login/logout/password/register will receive the same parameter - "$redirect".

Also, we remove the old "$before" and "$after" parameters, and move the "<li></li>" html tags out from those functions to theme developers control outside the function.

For backward compatibility we use:

wp-includes/deprecated.php

function wp_register( $before = '<li>', $after = '</li>' ) { 
   _deprecated_function(__FUNCTION__, '2.8.1', 'wp_registration()'); 
   echo $before; 
   wp_registration(''); 
   echo $after; 
}

The result is that all the url_functions will return only the URL.

#5 @ramiy
10 years ago

URL Functions:

  • wp_login_url($redirect);
  • wp_logout_url($redirect);
  • wp_lostpassword_url($redirect);
  • wp_registration_url($redirect);

Theme Developers will use:

  • wp_logout();
  • wp_loginout();
  • wp_registration();

#6 @ryan
10 years ago

  • Milestone changed from 2.9 to Future Release

#7 @mikeschinkel
10 years ago

  • Cc mikeschinkel@… added

#8 follow-up: @Axel_germany
9 years ago

  • Component changed from Themes to Plugins
  • Type changed from enhancement to feature request
  • Version changed from 2.8 to 3.1

Hi Ramiy,

thanks for implementing the function wp_lostpassword_url($redirect);
Is there a reason why it is not yet used in wp-login.php line 616 and 618? (development version (3.1-alpha)). The reason I'm asking is because I want to use the plugin hook 'lostpassword_url' (http://codex.wordpress.org/Function_Reference/wp_lostpassword_url) in a plugin and this hook only works when wp_lostpassword_url($)
is called.

Thanks

Axel

#9 in reply to: ↑ 8 ; follow-up: @Axel_germany
9 years ago

Replying to Axel_germany:
I'm using svn revision 15634.

#10 @mrmist
9 years ago

  • Version changed from 3.1 to 2.8

#11 @Axel_germany
9 years ago

The same applies to wp-includes/user.php line 89 and 109 (and probably some more places).

#12 in reply to: ↑ 9 @ramiy
9 years ago

  • Cc ramiy added
  • Owner set to ramiy
  • Status changed from new to reviewing

Replying to Axel_germany:

well, we can add it to 3.1.

#13 @iseulde
6 years ago

  • Component changed from Plugins to Template
  • Keywords needs-refresh reporter-feedback added
  • Type changed from feature request to enhancement

wp_registration_url() has been implemented in 3.6, though it doesn't have the $redirect you wanted.

#15 @ramiy
6 years ago

wp_registration_url() has was introduced in 3.6, should we close this ticket? Or should we consider adding the $redirect parameter to this function?

#16 @ramiy
6 years ago

  • Resolution set to duplicate
  • Status changed from reviewing to closed

Duplicate of #17950.

Fixed in changeset #24053.

#17 @ocean90
6 years ago

  • Keywords needs-refresh reporter-feedback removed
  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.