예제 #1
0
 /**
  * Set up globals necessary to avoid errors when using wp_mail()
  */
 public static function setUp_wp_mail($args)
 {
     if (isset($_SERVER['SERVER_NAME'])) {
         self::$cached_SERVER_NAME = $_SERVER['SERVER_NAME'];
     }
     $_SERVER['SERVER_NAME'] = 'example.com';
     // passthrough
     return $args;
 }
예제 #2
0
 /**
  * Tear down globals set up in setUp_wp_mail()
  */
 public static function tearDown_wp_mail($args)
 {
     if (!empty(self::$cached_SERVER_NAME)) {
         $_SERVER['SERVER_NAME'] = self::$cached_SERVER_NAME;
         self::$cached_SERVER_NAME = '';
     } else {
         unset($_SERVER['SERVER_NAME']);
     }
     // passthrough
     return $args;
 }