Opened 2 years ago
Closed 8 months ago
#16411 closed enhancement (invalid)
Custom Login and Registration URLs
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | trac@… |
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 (12)
comment:1
danielpataki
— 2 years ago
comment:2
follow-up:
↓ 3
SergeyBiryukov
— 2 years ago
There are plugins for that. Theme My Login is one for example.
comment:3
in reply to:
↑ 2
markmcwilliams
— 2 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!
comment:4
follow-up:
↓ 5
SergeyBiryukov
— 2 years ago
Theme My Login can do that. Sorry for the wrong link, fixed.
comment:5
in reply to:
↑ 4
markmcwilliams
— 2 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!
comment:6
danielpataki
— 2 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.
comment:7
ptahdunbar
— 2 years ago
- Cc trac@… added
comment:8
Moskjis
— 2 years ago
There exists a wp_login_form function to address this (at least, part of it).
comment:9
RyanMurphy
— 2 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.
comment:10
sucipto82
— 11 months ago
- Summary changed from Custom Login and Registration URLs to http://scrapeboxmurah.blogspot.com/2012/05/iklan-internet-murah-efektif.html
spam
comment:11
dd32
— 11 months ago
- Summary changed from http://scrapeboxmurah.blogspot.com/2012/05/iklan-internet-murah-efektif.html to Custom Login and Registration URLs
comment:12
scribu
— 8 months ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Just want to add quickly, that this can also be accomplished in another bad way like this:
add_action("init", "bsb_register_redirect") ; function bsb_register_redirect() { if(get_current_url(true) == get_bloginfo('url')."/wp-login.php?action=register") header("Location: http://bitesizebio.com/register/"); }