Make WordPress Core

Changeset 48704


Ignore:
Timestamp:
07/31/2020 05:22:06 PM (5 years ago)
Author:
whyisjake
Message:

Upgrade/Install: Ensure the proper count of plugins that have auto-update enabled.

As certain plugins may not support updates, this count needs to accurately reflect that in the navbar.

This brings the changes from [48703] to the WordPress 5.5 branch.

Fixes 50808.
Props knutsp, audrasjb, pbiron, dd32, apedog, afragen, chriscct7, garyc40, whyisjake, SergeyBiryukov.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-admin/includes/class-wp-plugins-list-table.php

    r48678 r48704  
    280280
    281281            if ( $this->show_autoupdates ) {
    282                 if ( in_array( $plugin_file, $auto_updates, true ) ) {
    283                     $plugins['auto-update-enabled'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
     282                $enabled = in_array( $plugin_file, $auto_updates, true ) && $plugin_data['update-supported'];
     283                if ( isset( $plugin_data['auto-update-forced'] ) ) {
     284                    $enabled = (bool) $plugin_data['auto-update-forced'];
     285                }
     286
     287                if ( $enabled ) {
     288                    $plugins['auto-update-enabled'][ $plugin_file ] = $plugin_data;
    284289                } else {
    285                     $plugins['auto-update-disabled'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
     290                    $plugins['auto-update-disabled'][ $plugin_file ] = $plugin_data;
    286291                }
    287292            }
Note: See TracChangeset for help on using the changeset viewer.