andrezrv
4/7/2014 - 7:40 PM

Avoid sending mails when working locally.

Avoid sending mails when working locally.

<?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;
	}
}