Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active July 2, 2020 05:31
Show Gist options
  • Save KaineLabs/577d094c67e585729da12cdddde9ffb8 to your computer and use it in GitHub Desktop.
Save KaineLabs/577d094c67e585729da12cdddde9ffb8 to your computer and use it in GitHub Desktop.
Redirect "wp-login.php" Page To Youzer Login Page
<?php
/**
* Redirect "wp-login.php" Page To Youzer Login Page.
*/
function yz_redirect_wplogin_to_youzer_login_page() {
if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'logout' || $_GET['action'] == 'lostpassword' || $_GET['action'] == 'rp' || $_GET['action'] == 'bp-resend-activation' ) ) {
return;
}
global $pagenow;
if ( 'wp-login.php' == $pagenow && $_SERVER['REQUEST_METHOD'] == 'GET' ) {
// Get Login Page Url.
$login_url = 'add-your-custom-login-page-url-here';
// Redirect !!
wp_redirect( $login_url );
exit();
}
}
add_action( 'init', 'yz_redirect_wplogin_to_youzer_login_page' );
@zaheera5699
Copy link

Hi,
Sir, how will I add this code to my website?

@KaineLabs
Copy link
Author

Hi,
Sir, how will I add this code to my website?

You can add it to the file "bp-custom.php" in the path "wp-content/plugins".
Ps: if you didn't find the file "bp-custom.php", just create a new one.​

@zaheera5699
Copy link

Sir, I add this code on the "bp-custom.php" file but this code is not work. Please help.....

Screenshoot:
https://prnt.sc/su5bbh
http://prnt.sc/su5bh8

@zaheera5699
Copy link

Hi,
Sir, how will I add this code to my website?

You can add it to the file "bp-custom.php" in the path "wp-content/plugins".
Ps: if you didn't find the file "bp-custom.php", just create a new one.​

Hello Sir, Sir, I add this code on the "bp-custom.php" file but this code is not work. Please help.....

Screenshoot:
https://prnt.sc/su5bbh
http://prnt.sc/su5bh8

Please Help....

@zaheera5699
Copy link

zaheera5699 commented Jun 10, 2020 via email

@KaineLabs
Copy link
Author

Hello, Sir, I add this code on the "bp-custom.php" file but this code is not work. Please help..... Screenshoot: https://prnt.sc/su5bbh http://prnt.sc/su5bh8 Please Help....

On Fri, Jun 5, 2020, 6:32 AM KaineLabs @.***> wrote: @KaineLabs commented on this gist. ------------------------------ Hi, Sir, how will I add this code to my website? You can add it to the file "bp-custom.php" in the path "wp-content/plugins". Ps: if you didn't find the file "bp-custom.php", just create a new one.​— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://gist.github.com/577d094c67e585729da12cdddde9ffb8#gistcomment-3330381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL57ZMAU73KDPYWKQHHTWTTRVBDLBANCNFSM4NSV2E2A .

Hello,

Sorry for the delay i'm not active here on github, i came here only when i want to add new snippets.

Please consider using our support forum kainelabs.ticksy.com and our support team will help you :)

Stay safe.

Best Regards, Youssef

@zaheera5699
Copy link

Hi,
Sir, i have create a new one "bp-custom.php" in the path "wp-content/plugins" and add this code. But does not redirect the URL "https://offermom.com/wp-login.php" to https://offermom.com/login/

Screenshoot: http://prnt.sc/sx6lvt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment