So, there are many ways you could achieve this, but this simplest would be to filter site_url() looking for the specific path that TML uses:
function my_custom_site_url_filter( $url, $path, $scheme, $blog_id ) {
if ( 'wp-login.php?registration=complete' == $path ) {
$url = get_home_url( $blog_id, '/', $scheme );
}
return $url;
}
add_filter( 'site_url', 'my_custom_site_url_filter', 5, 4 );
As far as the email is concerned, you can enable the Custom E-mails module and disable it or change it if you’d like.
Thank very much! It’s perfect!
Other question: After a “Lost Password demand”, we are redirect to https://mydomain.com/wp-login.php?action=login&checkemail=confirm. There is a solution to redirect to homepage url too?
Thanks for your help!
Change the above function definition to:
function my_custom_site_url_filter( $url, $path, $scheme, $blog_id ) {
if ( in_array( $path, array(
'wp-login.php?registration=complete',
'wp-login.php?checkemail=confirm'
) ) ) {
$url = get_home_url( $blog_id, '/', $scheme );
}
return $url;
}
add_filter( 'site_url', 'my_custom_site_url_filter', 5, 4 );
-
This reply was modified 8 years, 4 months ago by
Jeff Farthing. Reason: Missing bracket
Unfortunately the second redirection does’nt work…
Change that function back to the original one and add this:
function my_custom_lostpassword_redirect( $url ) {
return home_url( '/' );
}
add_filter( 'lostpassword_redirect', 'my_custom_lostpassword_redirect' );
Thank you! Everything’s OK.
When I use the module “Custom email” (Retrieve Password), the %reseturl% URL is:
https://mydomain.com/wp-login.php?action=rp&key=ZptHViIDHK5WL8OMhAWN&login=test.test%40gmail.com
But must be the link to “Reset Password” like:
https://mydomain/resetpass/?key=elcYs4zrYN2BZBA6p1NO&login=test.test%40gmail.com
How can I resolve this?
Does the Reset Password page exist and if so, is it the page that the plugin created?
Yes the page exist and is the page that the plugin created.
-
This reply was modified 8 years, 3 months ago by
ergopix.
Can you verify that there is a custom meta field _tml_action with a value of “resetpass” for that page?
Yes, the custom meta field _tml_action contain “resetpass”.
-
This reply was modified 8 years, 3 months ago by
ergopix.
It’s not in the trash, right?
I’m running out of ideas… Make sure your permalinks are updated?
I update permalink but nothing change.
I try to see in the plugin code. In custom-email.php the function is:
public function retrieve_pass_message_filter( $message, $key, $user_login, $user_data ) {
$_message = $this->get_option( array( 'retrieve_pass', 'message' ) );
if ( ! empty( $_message ) ) {
$message = Theme_My_Login_Common::replace_vars( $_message, $user_data->ID, array(
'%loginurl%' => site_url( 'wp-login.php', 'login' ),
'%reseturl%' => site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' )
));
}
return $message;
}
So it’s normal to have: https://mydomain.com/wp-login.php?action=rp&key=ZptHViIDHK5WL8OMhAWN&login=test.test%40gmail.com
instead: https://mydomain.com/resetpass/?key=elcYs4zrYN2BZBA6p1NO&login=test.test%40gmail.com
No?
-
This reply was modified 8 years, 3 months ago by
ergopix.
No, because TML has a filter on site_url that converts wp-login.php URLs into TML URLs.