Make WordPress Core

Ticket #50848: 50848-alt.diff

File 50848-alt.diff, 3.8 KB (added by audrasjb, 3 years ago)

Upgrade/Install: use false instead null value in auto_update_{$type} filter

  • src/wp-admin/includes/class-wp-debug-data.php

    diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php
    index 7e21785cce..5d145fab52 100644
    a b class WP_Debug_Data { 
    979979
    980980                                $type = 'plugin';
    981981                                /** 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 );
     982                                $auto_update_forced = apply_filters( "auto_update_{$type}", false, (object) $item );
    983983
    984                                 if ( ! is_null( $auto_update_forced ) ) {
     984                                if ( false !== $auto_update_forced ) {
    985985                                        $enabled = $auto_update_forced;
    986986                                } else {
    987987                                        $enabled = in_array( $plugin_path, $auto_updates, true );
    class WP_Debug_Data { 
    11231123
    11241124                        $type = 'theme';
    11251125                        /** 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 );
     1126                        $auto_update_forced = apply_filters( "auto_update_{$type}", false, (object) $item );
    11271127
    1128                         if ( ! is_null( $auto_update_forced ) ) {
     1128                        if ( false !== $auto_update_forced ) ) {
    11291129                                $enabled = $auto_update_forced;
    11301130                        } else {
    11311131                                $enabled = in_array( $active_theme->stylesheet, $auto_updates, true );
    class WP_Debug_Data { 
    12111211
    12121212                                $type = 'theme';
    12131213                                /** 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 );
     1214                                $auto_update_forced = apply_filters( "auto_update_{$type}", false, (object) $item );
    12151215
    1216                                 if ( ! is_null( $auto_update_forced ) ) {
     1216                                if ( false !== $auto_update_forced ) {
    12171217                                        $enabled = $auto_update_forced;
    12181218                                } else {
    12191219                                        $enabled = in_array( $parent_theme->stylesheet, $auto_updates, true );
    class WP_Debug_Data { 
    13011301
    13021302                                $type = 'theme';
    13031303                                /** 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 );
     1304                                $auto_update_forced = apply_filters( "auto_update_{$type}", false, (object) $item );
    13051305
    1306                                 if ( ! is_null( $auto_update_forced ) ) {
     1306                                if ( false !== $auto_update_forced ) {
    13071307                                        $enabled = $auto_update_forced;
    13081308                                } else {
    13091309                                        $enabled = in_array( $theme_slug, $auto_updates, true );
  • src/wp-admin/includes/class-wp-plugins-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php
    index e487e32cfb..eeb065ecc7 100644
    a b class WP_Plugins_List_Table extends WP_List_Table { 
    233233
    234234                        $type = 'plugin';
    235235                        /** 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 );
     236                        $auto_update_forced = apply_filters( "auto_update_{$type}", false, $filter_payload );
    237237
    238                         if ( ! is_null( $auto_update_forced ) ) {
     238                        if ( false !== $auto_update_forced ) {
    239239                                $plugin_data['auto-update-forced'] = $auto_update_forced;
    240240                        }
    241241
  • src/wp-admin/includes/theme.php

    diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php
    index 21730339cd..38bf3c9dfb 100644
    a b function wp_prepare_themes_for_js( $themes = null ) { 
    718718
    719719                $type = 'theme';
    720720                /** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
    721                 $auto_update_forced = apply_filters( "auto_update_{$type}", null, $auto_update_filter_payload );
     721                $auto_update_forced = apply_filters( "auto_update_{$type}", false, $auto_update_filter_payload );
    722722
    723723                $prepared_themes[ $slug ] = array(
    724724                        'id'             => $slug,