WordPress Core Automatic Updates: Add a filter as to whether or not to send the site administrator a summary of executed updates. Props JustinSainton. See #22704

Built from https://develop.svn.wordpress.org/trunk@25542


git-svn-id: http://core.svn.wordpress.org/trunk@25462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2013-09-21 07:00:10 +00:00
parent a82b463610
commit 2c3a35491b

View File

@ -1508,7 +1508,19 @@ class WP_Automatic_Upgrader {
wp_update_themes(); // Check for Theme updates
wp_update_plugins(); // Check for Plugin updates
self::send_email();
/**
* Filter whether to email an update summary to the site administrator.
*
* @since 3.7.0
*
* @param bool Whether or not email should be sent to administrator. Default true.
* @param bool|array $core_update An array of core update data, false otherwise.
* @param object $theme_updates Object containing theme update properties.
* @param object $plugin_updates Object containing plugin update properties.
* @param array $upgrade_results An array of the upgrade results keyed by upgrade type, and plugin/theme slug
*/
if ( apply_filters( 'enable_auto_upgrade_email', true, $core_update, $theme_updates, $plugin_updates, self::$upgrade_results ) )
self::send_email();
// Clear the lock
delete_site_option( $lock_name );
@ -1590,7 +1602,7 @@ class WP_Automatic_Upgrader {
wp_mail(
get_site_option( 'admin_email' ),
$subject,
implode( "\n", $body )
implode( "\n", $body )
);
}