Created
February 7, 2023 03:22
-
-
Save tarecord/cc1936c9786461ec5d03f37fd223ff11 to your computer and use it in GitHub Desktop.
A plugin that disables all WordPress emails sent using wp_mail()
This file contains 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 | |
/** | |
* Plugin Name: Disable Email | |
* Plugin URI: https://www.tannerrecord.com/micro-plugins/disable-email | |
* Description: A plugin that disables all email sent using <code>wp_mail()</code>. | |
* Author: Tanner Record | |
* Author URI: https://www.tannerrecord.com | |
* Update URI: false | |
* Version: 1.0 | |
*/ | |
add_filter( 'pre_wp_mail', 'tarecord_disable_email' ); | |
function tarecord_disable_email() { | |
do_action( 'wp_mail_succeeded' ); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment