WordPress.org

Make WordPress Core

Ticket #50988: 50988.diff

File 50988.diff, 1.8 KB (added by audrasjb, 3 months ago)

Upgrade/Install: Pass the result of plugins or themes update tasks to auto_plugin_update_send_email and auto_theme_update_send_email filters.

  • src/wp-admin/includes/class-wp-automatic-updater.php

    diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php
    index 4cf2b0b75b..2370d452e8 100644
    a b class WP_Automatic_Updater { 
    889889                 * Filters whether to send an email following an automatic background plugin update.
    890890                 *
    891891                 * @since 5.5.0
     892                 * @since 5.5.1 Added the $update_results parameter.
    892893                 *
    893                  * @param bool $enabled True if plugins notifications are enabled, false otherwise.
     894                 * @param bool  $enabled        True if plugins notifications are enabled, false otherwise.
     895                 * @param array $update_results The result of plugins updates tasks.
    894896                 */
    895                 $notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true );
     897                $notifications_enabled = apply_filters( 'auto_plugin_update_send_email', true, $update_results['plugin'] );
    896898
    897899                if ( ! empty( $update_results['plugin'] ) && $notifications_enabled ) {
    898900                        foreach ( $update_results['plugin'] as $update_result ) {
    class WP_Automatic_Updater { 
    908910                 * Filters whether to send an email following an automatic background theme update.
    909911                 *
    910912                 * @since 5.5.0
     913                 * @since 5.5.1 Added the $update_results parameter.
    911914                 *
    912                  * @param bool $enabled True if notifications are enabled, false otherwise.
     915                 * @param bool  $enabled True if notifications are enabled, false otherwise.
     916                 * @param array $update_results The result of plugins updates tasks.
    913917                 */
    914                 $notifications_enabled = apply_filters( 'auto_theme_update_send_email', true );
     918                $notifications_enabled = apply_filters( 'auto_theme_update_send_email', true, $update_results['theme'] );
    915919
    916920                if ( ! empty( $update_results['theme'] ) && $notifications_enabled ) {
    917921                        foreach ( $update_results['theme'] as $update_result ) {