Last active
June 8, 2023 17:38
-
-
Save pstoute/2b5b4e8a5d534e5bbc7a3f17f330e4b5 to your computer and use it in GitHub Desktop.
This snippet is used to prevent the emails that are sent when things are auto updated within WordPress
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 | |
/** | |
* Disable Auto Update Emails | |
* | |
* Plugin Name: Disable Auto Update Emails | |
* Description: Disable the emails that are sent when plugins, themes, and WP Core are auto updated. | |
* Version: 0.1.0 | |
* Author: Paul Stoute | |
* Author URI: https://stoute.co | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
*/ | |
// Stop the auto update emails for WP Core updates | |
add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 ); | |
function stop_update_emails( $send, $type, $core_update, $result ) { | |
if ( ! empty( $type ) && $type == 'success' ) { | |
return false; | |
} | |
return true; | |
} | |
// Stop the auto update emails for plugins | |
add_filter( 'auto_plugin_update_send_email', '__return_false' ); | |
// Stop the auto update emails for themes | |
add_filter( 'auto_theme_update_send_email', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment