Make WordPress Core

Changeset 48888


Ignore:
Timestamp:
08/27/2020 07:25:38 PM (4 years ago)
Author:
desrosj
Message:

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.
Fixes #50988.

File:
1 edited

Legend:

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

    r48750 r48888  
    880880     * @since 5.5.0
    881881     *
    882      * @param array $update_results The result of updates tasks.
     882     * @param array $update_results The results of update tasks.
    883883     */
    884884    protected function after_plugin_theme_update( $update_results ) {
     
    890890         *
    891891         * @since 5.5.0
    892          *
    893          * @param bool $enabled True if plugins notifications are enabled, false otherwise.
     892         * @since 5.5.1 Added the $update_results parameter.
     893         *
     894         * @param bool  $enabled        True if plugins notifications are enabled, false otherwise.
     895         * @param array $update_results The results of plugins update 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 ) {
     
    909911         *
    910912         * @since 5.5.0
    911          *
    912          * @param bool $enabled True if notifications are enabled, false otherwise.
     913         * @since 5.5.1 Added the $update_results parameter.
     914         *
     915         * @param bool  $enabled True if notifications are enabled, false otherwise.
     916         * @param array $update_results The results of theme update 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 ) {
Note: See TracChangeset for help on using the changeset viewer.