Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Disable Redirection to Specific Page
  5. */
  6. function my_wp_redirect($location) {
  7.  
  8. // TODO: Change '10' to the page id that should not be redirected to
  9. $page_id = 10;
  10.  
  11. if($location == get_the_permalink( $page_id ) ) {
  12. $location = false;
  13. }
  14.  
  15. return $location;
  16. }
  17. add_filter('wp_redirect', 'my_wp_redirect');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement