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-debug-data.php

    r48802 r49241  
    978978                }
    979979
    980                 $type = 'plugin';
    981                 /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    982                 $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
     980                $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, (object) $item );
    983981
    984982                if ( ! is_null( $auto_update_forced ) ) {
     
    11221120            }
    11231121
    1124             $type = 'theme';
    1125             /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1126             $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
     1122            $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
    11271123
    11281124            if ( ! is_null( $auto_update_forced ) ) {
     
    12101206                }
    12111207
    1212                 $type = 'theme';
    1213                 /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1214                 $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
     1208                $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
    12151209
    12161210                if ( ! is_null( $auto_update_forced ) ) {
     
    13001294                }
    13011295
    1302                 $type = 'theme';
    1303                 /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1304                 $auto_update_forced = apply_filters( "auto_update_{$type}", null, (object) $item );
     1296                $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item );
    13051297
    13061298                if ( ! is_null( $auto_update_forced ) ) {
     
    13281320
    13291321                $theme_version_string       .= ' | ' . $auto_updates_string;
    1330                 $theme_version_string_debug .= ',' . $auto_updates_string;
     1322                $theme_version_string_debug .= ', ' . $auto_updates_string;
    13311323            }
    13321324
Note: See TracChangeset for help on using the changeset viewer.