#16411 closed enhancement (invalid)
Custom Login and Registration URLs
Reported by: | danielpataki | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
For bigger websites it would be beneficial to allow custom registrations by being able to change the login and registration urls. You can change the login url in a haphazard way now like this, but this is not very good.
function bsb_login_url($redirect_to) { $redirect_to = str_replace(get_bloginfo("url").'/wp-login.php', '', $redirect_to); $link = get_bloginfo("url")."/login/".$redirect_to; return $link; } add_filter( 'login_url', 'bsb_login_url' );
Looking at wp-login.php, the registration link is output like this:
<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
If, by using a filter, hook, or even a definition in the config file, you could change the url output here that would be nice.
Change History (11)
#2
follow-up:
↓ 3
@
14 years ago
There are plugins for that. Theme My Login is one for example.
#3
in reply to:
↑ 2
@
14 years ago
Replying to SergeyBiryukov:
There are plugins for that. Theme My Login is one for example.
I think he's on about having site.com/login/ and site.com/register/ instead of the site.com/wp-login.php and site.com/wp-login.php?action=register we currently have, although this will more than likely be plugin material, as it can be achieved through either functions.php or a plugin!
#5
in reply to:
↑ 4
@
14 years ago
Replying to SergeyBiryukov:
Theme My Login can do that. Sorry for the wrong link, fixed.
Oh, I never noticed I was looking at the wrong plugin!
#6
@
14 years ago
It's not the fact that it can not be done which is the problem, I just think that this should be something the core could support. For larger websites, having a more elaborate registration, lost password and login process is a must, and it would be easier to achieve with built in support.
#8
@
14 years ago
There exists a wp_login_form function to address this (at least, part of it).
#9
@
14 years ago
Ozh has a plugin that does /login instead of /wp-login.php. I don't think it would be too hard for it to also handle /register if someone asked/sent him a patch.
#12
@
12 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
There's nothing haphazard about using the 'login_url' filter; it's the standard way of extending WordPress.
What's missing is a matching wp_register_url() and is_login_url() functions, which are addressed in #19898
Just want to add quickly, that this can also be accomplished in another bad way like this: