Notifications
Clear all

[Solved] Redirection link to login

6 Posts
3 Users
0 Reactions
3,756 Views
BillMoo
(@billmoo)
Eminent Member
Joined: 6 years ago
Posts: 20
Topic starter  

Hello,

I would like to change the link to login :

wpDiscuz guest commenting is disabled please login to comment[1]

I have a special page for that and I don't want the visitors see the "wp-admin" login secret url

Thank you for your help.


   
Quote
(@markoz)
Member Customer
Joined: 6 years ago
Posts: 31
 
Posted by: BillMoo

Hello,

I would like to change the link to login :

wpDiscuz guest commenting is disabled please login to comment[1]

I have a special page for that and I don't want the visitors see the "wp-admin" login secret url

Thank you for your help.

I would also like to know how to connect with Ultimate Member login which is placed at  .../login/

For now users if they want to comment something have to login twice, once trough UM and second time trough wordpress...

Thanks in advance...


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4209
 

wpDiscuz uses wp_login_url() (/wp-includes/general-template.php) which uses a filter on its return:

return apply_filters('login_url', $login_url, $redirect);

you might be able to add a filter function to functions.php of your theme, to influence the link; example:

add_filter( 'login_url', 'my_login_linkchanger');
function my_login_linkchanger( $link ) {
/*whatever you need to do with the link*/
return home_url( '/my-custom-login-page/' );
}

More info: http://codex.wordpress.org/Plugin_API/Filter_Reference/login_url


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4209
 
Posted by: MarkoZ
Posted by: BillMoo

Hello,

I would like to change the link to login :

wpDiscuz guest commenting is disabled please login to comment[1]

I have a special page for that and I don't want the visitors see the "wp-admin" login secret url

Thank you for your help.

I would also like to know how to connect with Ultimate Member login which is placed at  .../login/

For now users if they want to comment something have to login twice, once trough UM and second time trough wordpress...

Thanks in advance...

UM user login is the same WordPress login and it's the same wpDiscuz login. If user is loggedin from any of login forms he/she don't need login again.


   
ReplyQuote
BillMoo
(@billmoo)
Eminent Member
Joined: 6 years ago
Posts: 20
Topic starter  
Posted by: Tom

you might be able to add a filter function to functions.php of your theme, to influence the link; example:

add_filter( 'login_url', 'my_login_linkchanger');
function my_login_linkchanger( $link ) {
/*whatever you need to do with the link*/
return home_url( '/my-custom-login-page/' );
}

Thank you very much Tom ! It works perfectly !


   
ReplyQuote
(@markoz)
Member Customer
Joined: 6 years ago
Posts: 31
 
Posted by: BillMoo
Posted by: Tom

you might be able to add a filter function to functions.php of your theme, to influence the link; example:

add_filter( 'login_url', 'my_login_linkchanger');
function my_login_linkchanger( $link ) {
/*whatever you need to do with the link*/
return home_url( '/my-custom-login-page/' );
}

Thank you very much Tom ! It works perfectly !

This worked for me as well. Thank you Tom

Problem was for not logged in user. When he press link to log in here it will lead him to WP login instead of UM form

Screen Shot 2019 01 02 at 11.34.22

When user is logged in already, there was no issue.

Anyhow, it's working now. 

Thanks!


   
ReplyQuote
Share:
Scroll to top