Created
August 23, 2019 13:13
-
-
Save justingreerbbi/c8281d110588ea63dd39a4c1556868c4 to your computer and use it in GitHub Desktop.
Proper Custom Login WordPress Redirect Snippet
This file contains hidden or 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
| function _proper_custom_login_redirect_intercept( $template ) { | |
| if ( ! is_user_logged_in() ) { | |
| wp_safe_redirect( site_url( '/member-login/' ) ); | |
| exit; | |
| } | |
| return $template; | |
| } | |
| add_filter( 'template_include', '_proper_custom_login_redirect_intercept', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment