Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #39 from audrasjb/add/plugins-screen-remove-column…
Browse files Browse the repository at this point in the history
…-when-unwanted

Plugins screen: Remove auto-updates column from mustuse and dropins screens
  • Loading branch information
audrasjb authored Mar 6, 2020
2 parents fcd2a5a + 00a4252 commit e5a725d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wp-autoupdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ function wp_autoupdates_selected_plugins( $update, $item ) {
* Add autoupdate column to plugins screen.
*/
function wp_autoupdates_add_plugins_autoupdates_column( $columns ) {
$columns['autoupdates_column'] = __( 'Automatic updates', 'wp-autoupdates' );
if ( 'mustuse' !== $_GET['plugin_status'] && 'dropins' !== $_GET['plugin_status'] ) {
$columns['autoupdates_column'] = __( 'Automatic updates', 'wp-autoupdates' );
}
return $columns;
}
add_filter( is_multisite() ? 'manage_plugins-network_columns' : 'manage_plugins_columns', 'wp_autoupdates_add_plugins_autoupdates_column' );
Expand All @@ -106,6 +108,9 @@ function wp_autoupdates_add_plugins_autoupdates_column_content( $column_name, $p
$plugins_updates = get_site_transient( 'update_plugins' );
$page = isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ? wp_unslash( esc_html( $_GET['paged'] ) ) : '';
if ( wp_autoupdates_is_plugins_auto_update_enabled() ) {
if ( ! isset( $plugins[ $plugin_file ] ) ) {
return;
}
$wp_auto_update_plugins = get_site_option( 'wp_auto_update_plugins', array() );
if ( in_array( $plugin_file, $wp_auto_update_plugins, true ) ) {
$aria_label = esc_attr(
Expand Down

0 comments on commit e5a725d

Please sign in to comment.