rebase on oct-10-2023
This commit is contained in:
@@ -61,8 +61,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
$this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'plugin' )
|
||||
&& current_user_can( 'update_plugins' )
|
||||
&& ( ! is_multisite() || $this->screen->in_admin( 'network' ) )
|
||||
&& ! in_array( $status, array( 'mustuse', 'dropins' ), true );
|
||||
&& ( ! is_multisite() || $this->screen->in_admin( 'network' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,8 +261,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
}
|
||||
} elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
|
||||
|| ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
|
||||
// On the non-network screen, populate the active list with plugins that are individually activated.
|
||||
// On the network admin screen, populate the active list with plugins that are network-activated.
|
||||
/*
|
||||
* On the non-network screen, populate the active list with plugins that are individually activated.
|
||||
* On the network admin screen, populate the active list with plugins that are network-activated.
|
||||
*/
|
||||
$plugins['active'][ $plugin_file ] = $plugin_data;
|
||||
|
||||
if ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) {
|
||||
@@ -297,6 +298,15 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the array of plugins for the list table.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param array[] $plugins An array of arrays of plugin data, keyed by context.
|
||||
*/
|
||||
$plugins = apply_filters( 'plugins_list', $plugins );
|
||||
|
||||
$totals = array();
|
||||
foreach ( $plugins as $type => $list ) {
|
||||
$totals[ $type ] = count( $list );
|
||||
@@ -451,7 +461,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
/**
|
||||
* @global string $status
|
||||
* @return array
|
||||
*
|
||||
* @return string[] Array of column titles keyed by their column name.
|
||||
*/
|
||||
public function get_columns() {
|
||||
global $status;
|
||||
@@ -462,7 +473,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
'description' => __( 'Description' ),
|
||||
);
|
||||
|
||||
if ( $this->show_autoupdates ) {
|
||||
if ( $this->show_autoupdates && ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {
|
||||
$columns['auto-updates'] = __( 'Automatic Updates' );
|
||||
}
|
||||
|
||||
@@ -982,7 +993,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$checkbox = '';
|
||||
} else {
|
||||
$checkbox = sprintf(
|
||||
'<label class="screen-reader-text" for="%1$s">%2$s</label>' .
|
||||
'<label class="label-covers-full-cell" for="%1$s"><span class="screen-reader-text">%2$s</span></label>' .
|
||||
'<input type="checkbox" name="checked[]" value="%3$s" id="%1$s" />',
|
||||
$checkbox_id,
|
||||
/* translators: Hidden accessibility text. %s: Plugin name. */
|
||||
@@ -1021,8 +1032,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
||||
|
||||
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );
|
||||
$available_updates = get_site_transient( 'update_plugins' );
|
||||
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$extra_classes = '';
|
||||
@@ -1154,7 +1164,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
echo '</td>';
|
||||
break;
|
||||
case 'auto-updates':
|
||||
if ( ! $this->show_autoupdates ) {
|
||||
if ( ! $this->show_autoupdates || in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user