Last active
July 2, 2020 05:31
-
-
Save KaineLabs/577d094c67e585729da12cdddde9ffb8 to your computer and use it in GitHub Desktop.
Redirect "wp-login.php" Page To Youzer Login Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
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
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