From 9fceb569481562c152023286e5338e74f4c907a2 Mon Sep 17 00:00:00 2001 From: desrosj Date: Thu, 27 Aug 2020 19:34:05 +0000 Subject: [PATCH] Upgrade/Install: Pass details about the specific plugin and theme updates attempted to filters. This adds an additional parameter to the `auto_plugin_update_send_email` and `auto_theme_update_send_email` filters to provide the additional context of which updates were attempted and their outcome. This will help plugin and theme auto-update emails to be better tailored to a site owner's liking. Props audrasjb, Paddy Landau, desrosj. Merges [48888] to the 5.5 branch. Fixes #50988. Built from https://develop.svn.wordpress.org/branches/5.5@48889 git-svn-id: http://core.svn.wordpress.org/branches/5.5@48651 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-automatic-updater.php | 14 +++++++++----- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index 4cf2b0b75b..6f9bf7ec0f 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -879,7 +879,7 @@ class WP_Automatic_Updater { * * @since 5.5.0 * - * @param array $update_results The result of updates tasks. + * @param array $update_results The results of update tasks. */ protected function after_plugin_theme_update( $update_results ) { $successful_updates = array(); @@ -889,10 +889,12 @@ class WP_Automatic_Updater { * Filters whether to send an email following an automatic background plugin update. * * @since 5.5.0 + * @since 5.5.1 Added the $update_results parameter. * - * @param bool $enabled True if plugins notifications are enabled, false otherwise. + * @param bool $enabled True if plugins notifications are enabled, false otherwise. + * @param array $update_results The results of plugins update tasks. */ - $notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true ); + $notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] ); if ( ! empty( $update_results['plugin'] ) && $notifications_enabled ) { foreach ( $update_results['plugin'] as $update_result ) { @@ -908,10 +910,12 @@ class WP_Automatic_Updater { * Filters whether to send an email following an automatic background theme update. * * @since 5.5.0 + * @since 5.5.1 Added the $update_results parameter. * - * @param bool $enabled True if notifications are enabled, false otherwise. + * @param bool $enabled True if notifications are enabled, false otherwise. + * @param array $update_results The results of theme update tasks. */ - $notifications_enabled = apply_filters( 'auto_theme_update_send_email', true ); + $notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] ); if ( ! empty( $update_results['theme'] ) && $notifications_enabled ) { foreach ( $update_results['theme'] as $update_result ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 153aa72f1e..25737678a6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5.1-alpha-48887'; +$wp_version = '5.5.1-alpha-48889'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.