Make WordPress Core

Ticket #33932: patch.2.diff

File patch.2.diff, 1.5 KB (added by ronalfy, 9 years ago)

Simplified filter.

  • class-wp-upgrader.php

     
    33573357
    33583358                // Plugins, Themes, Translations
    33593359                foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
     3360               
     3361            /**
     3362            * Filter to receive notification emails on plugins/themes/translators.
     3363            *
     3364            * By default, administrators are notified when the update offer received
     3365            * from WordPress.org sets a particular flag. This allows some discretion
     3366            * in if and when to notify.
     3367            *
     3368            * This filter is only evaluated once per plugin update
     3369            *.
     3370            *
     3371            * @since 4.4.0
     3372            *
     3373            * @param bool   $notify Whether the site administrator is notified.
     3374            * @param string $type   The type of update (plugin, theme, translation).
     3375            */
     3376                if ( 'plugin' == $type && !apply_filters( 'send_update_notification_email', true, $type ) ) {
     3377                    return;
     3378            } elseif( 'theme' == $type && !apply_filters( 'send_update_notification_email', true, $type ) ) {
     3379                return;
     3380            } elseif( 'translation' == $type && !apply_filters( 'send_update_notification_email', true, $type ) ) {
     3381                return;
     3382            }
    33603383                        if ( ! isset( $this->update_results[ $type ] ) )
    33613384                                continue;
    33623385                        $success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) );