Make WordPress Core


Ignore:
Timestamp:
09/25/2015 02:28:23 PM (9 years ago)
Author:
johnbillion
Message:

Introduce a send_update_notification_email which controls whether an update notification email is sent for background updates. This filter allows control over each of the update types (plugin, theme, translation) and compliments the automatic_updates_send_debug_email and send_core_update_notification_email filters.

Fixes #33932
Props ronalfy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r34499 r34543  
    33693369        // Plugins, Themes, Translations
    33703370        foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
     3371           
     3372            /**
     3373             * Filter to control whether a notification email is sent to the site admin email address for
     3374             * plugin, theme, and translation updates.
     3375             *
     3376             * By default, this only has an effect when automatic background updates are enabled and a
     3377             * development version of WordPress is in use.
     3378             *
     3379             * @since 4.4.0
     3380             *
     3381             * @param bool                 $notify Whether the site administrator is notified.
     3382             * @param string               $type   The type of update. One of 'plugin', 'theme', or 'translation'.
     3383             * @param WP_Automatic_Updater $this   The WP_Automatic_Updater instance.
     3384             */
     3385            if ( ! apply_filters( 'send_update_notification_email', true, $type, $this ) ) {
     3386                continue;
     3387            }
     3388
    33713389            if ( ! isset( $this->update_results[ $type ] ) )
    33723390                continue;
     
    34013419            }
    34023420            $body[] = '';
     3421        }
     3422
     3423        if ( empty( $body ) ) {
     3424            return;
    34033425        }
    34043426
Note: See TracChangeset for help on using the changeset viewer.