Changeset 2370971
- Timestamp:
- 08/28/2020 10:10:24 AM (6 years ago)
- Location:
- disable-plugin-autoupdate-emails/trunk
- Files:
-
- 2 edited
-
disable-plugin-autoupdate-emails.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-plugin-autoupdate-emails/trunk/disable-plugin-autoupdate-emails.php
r2363302 r2370971 4 4 * Plugin Name: Disable Plugin Autoupdate Emails 5 5 * Description: Getting too many "plugin updated" or "theme updated" emails since WordPress 5.5? This turns them off. 6 * Version: 1.0.0 6 * Note: 1.1.0 supports WordPress 5.5.1, allowing mixed/failed update emails to continue sending. 7 * Version: 1.1.0 7 8 * Author: Shaun Simmons 8 9 * Author URI: https://github.com/simshaun … … 14 15 } 15 16 16 add_filter( 'auto_plugin_update_send_email', 'faf_disable_auto_update_email' ); 17 add_filter( 'auto_theme_update_send_email', 'faf_disable_auto_update_email' ); 17 function faf_maybe_allow_auto_update_email( $true, $update_results = null ) { 18 if ( is_array( $update_results ) ) { 19 foreach ( $update_results as $update_result ) { 20 if ( true !== $update_result->result ) { 21 return $true; 22 } 23 } 24 } 25 26 return false; 27 } 28 29 // WordPress 5.5.0 — Blanket disable regardless of success/failure. 30 add_filter( 'auto_plugin_update_send_email', 'faf_disable_auto_update_email', 10, 1 ); 31 add_filter( 'auto_theme_update_send_email', 'faf_disable_auto_update_email', 10, 1 ); 32 33 // WordPress 5.5.1 — Disable if there were no failures. 34 // @see https://core.trac.wordpress.org/changeset/48889 35 add_filter( 'auto_plugin_update_send_email', 'faf_maybe_allow_auto_update_email', 10, 2 ); 36 add_filter( 'auto_theme_update_send_email', 'faf_maybe_allow_auto_update_email', 10, 2 ); -
disable-plugin-autoupdate-emails/trunk/readme.txt
r2363302 r2370971 3 3 Tags: updates, autoupdates, disable autoupdate email 4 4 Requires at least: 5.5 5 Tested up to: 5.5 6 Stable tag: 5.5 5 Tested up to: 5.5.1 6 Stable tag: 5.5.1 7 7 Requires PHP: 5.3 8 8 License: GPLv2 … … 14 14 15 15 There's not much to this plugin. It's a couple barebones filters that turn off the plugin and theme autoupdate emails. 16 On WordPress 5.5.0, the update emails are turned off regardless of whether or not the updates failed. 17 Since WordPress 5.5.1, emails indicating update failures are allowed to send. 16 18 17 19 == Changelog == 18 20 21 = 1.1 = 22 * Allow mixed/failure emails to get through (WordPress 5.5.1+) 23 19 24 = 1.0 = 20 25 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.