Created
December 2, 2021 13:06
-
-
Save qant/63b92c6de7ebca09e805367c05fe4b03 to your computer and use it in GitHub Desktop.
If not logged in. Redirect back to previous url, after login to the WordPress
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
| <?php | |
| //.... load wordpress stuff etc | |
| if(!is_user_logged_in()) { | |
| wp_redirect( wp_login_url($_SERVER['SCRIPT_URI']) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment