Advertisement
daymobrew

404-to-start - separate email alert and redirection

Mar 22nd, 2013
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. --- 404-to-start.orig.php   2013-03-21 22:08:06.000000000 +0000
  2. +++ 404-to-start.php    2013-03-22 14:48:27.000000000 +0000
  3. @@ -159,7 +159,7 @@
  4.  // 302=temporary
  5.  function f042start_output_header() {
  6.    
  7. -   if ( !is_404() || get_option("f042start_type")=="off" ) return;
  8. +   if ( !is_404() ) return;
  9.    
  10.     # setting default target to prevent errors
  11.     if (get_option('f042start_target')=="") {
  12. @@ -178,7 +178,9 @@
  13.         $message.="Remote Addres: ".$_SERVER['REMOTE_ADDR']."\n";
  14.         wp_mail( get_option("f042startemailaddres"), __('404 alert from ', 'f042start').get_bloginfo('name'), $message, "From: ".get_bloginfo('admin_email') );
  15.     }
  16. -   wp_redirect( $target, get_option("f042start_type") );
  17. +    if (get_option("f042start_type")!="off") {
  18. +     wp_redirect( $target, get_option("f042start_type") );
  19. +    }
  20.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement