Make WordPress Core


Ignore:
Timestamp:
07/31/2020 05:19:34 PM (6 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.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r48678 r48703  
    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.