Created
April 7, 2014 19:40
-
-
Save andrezrv/10037849 to your computer and use it in GitHub Desktop.
Avoid sending mails when working locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Avoid sending mails when working locally. | |
*/ | |
if ( ! function_exists( 'wp_mail' ) | |
&& defined( 'WP_STAGE' ) | |
&& 'local' == WP_STAGE | |
&& ( ! defined( 'WP_MAIL_LOCAL' ) || true !== WP_MAIL_LOCAL ) | |
) { | |
function wp_mail( $to, $subject, $message, $headers = '' ) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment