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-site-health.php

    r49237 r49241  
    23992399        );
    24002400
    2401         $type = 'plugin';
    2402         /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    2403         $test_plugins_enabled = apply_filters( "auto_update_{$type}", true, $mock_plugin );
    2404 
    2405         $type = 'theme';
    2406         /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    2407         $test_themes_enabled = apply_filters( "auto_update_{$type}", true, $mock_theme );
     2401        $test_plugins_enabled = wp_is_auto_update_forced_for_item( 'plugin', true, $mock_plugin );
     2402        $test_themes_enabled  = wp_is_auto_update_forced_for_item( 'theme', true, $mock_theme );
    24082403
    24092404        $ui_enabled_for_plugins = wp_is_auto_update_enabled_for_type( 'plugin' );
Note: See TracChangeset for help on using the changeset viewer.