Return to requested page after login
-
Code below will take you automatically to the wordpress login page and after successful login its will be back to the requested page. You just need to keep this code top of the page.
if(!function_exists(is_user_logged_in)){ die('Sorry, You do not have access of this page.'); } if ( !is_user_logged_in() ) { $returnPath = get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']); echo "<script type='text/javascript'>"; echo "window.location.href='$returnPath'"; echo "</script>"; exit(); }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Return to requested page after login’ is closed to new replies.