WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/20/2020 05:37:16 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Introduce a wrapper for the auto_update_{$type} filter checks.

This allows for cleaner checks whether auto-updates are forced for a plugin or theme.

Follow-up to [48750].

Props rebasaurus, garrett-eclipse, SergeyBiryukov.
Fixes #50875.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r48968 r49241  
    230230                'compatibility' => new stdClass(),
    231231            );
     232
    232233            $filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) );
    233234
    234             $type = 'plugin';
    235             /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    236             $auto_update_forced = apply_filters( "auto_update_{$type}", null, $filter_payload );
     235            $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload );
    237236
    238237            if ( ! is_null( $auto_update_forced ) ) {
Note: See TracChangeset for help on using the changeset viewer.