Make WordPress Core


Ignore:
Timestamp:
10/20/2020 05:37:16 PM (5 years 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-ms-themes-list-table.php

    r49108 r49241  
    182182            $filter_payload = array_merge( $filter_payload, array_intersect_key( $theme_data, $filter_payload ) );
    183183
    184             $type = 'theme';
    185             /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    186             $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $filter_payload );
     184            $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, $filter_payload );
    187185
    188186            if ( ! is_null( $auto_update_forced ) ) {
Note: See TracChangeset for help on using the changeset viewer.