Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Customize the login URL of your website
- * Paste this into your active theme's function.php file
- * @param string $login_url
- * @param string $redirect
- * @return string
- */
- add_filter( 'login_url', function( $login_url, $redirect ) {
- if( is_admin() ) {
- return $login_url;
- }
- // Change this to your own login URL path
- $custom_login_path = 'custom-login-page';
- $login_url = site_url( $custom_login_path, 'login' );
- if( !empty( $redirect )) {
- $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
- }
- return $login_url;
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment