Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?php
  2. if(!is_user_logged_in())
  3. wp_redirect('/login/');
  4. ?>
  5.  
  6. /wp-content/my-theme/my-account/
  7. /wp-content/my-theme/my-account/world.php
  8. /wp-content/my-theme/my-account/subscription.php
  9. /wp-content/my-theme/my-dashboard.php
  10. /wp-content/my-theme/my-files.php
  11.  
  12. <input type="hidden" name="redirect" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
  13.  
  14. if ( (isset($_GET['action']) && $_GET['action'] != 'logout') || (isset($_POST['login_location']) && !empty($_POST['login_location'])) ) {
  15. add_filter('login_redirect', 'my_login_redirect', 10, 3);
  16. function my_login_redirect() {
  17. $location = $_SERVER['HTTP_REFERER'];
  18. wp_safe_redirect($location);
  19. exit();
  20. }
  21. }
  22.  
  23. <?php
  24. if(!is_user_logged_in())
  25. wp_redirect('/login/?redirect_to=' . $_SERVER["REQUEST_URI"]);
  26. ?>
  27.  
  28. /login.php?redirect_to=/wp-content/my-theme/my-account/subscription.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement