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

Ensure "Automatic Updates" column is not added if no content would be output in the column #57

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions wp-autoupdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ function wp_autoupdates_selected_plugins( $update, $item ) {
* Add autoupdate column to plugins screen.
*/
function wp_autoupdates_add_plugins_autoupdates_column( $columns ) {
if ( ! current_user_can( 'update_plugins' ) || ! wp_autoupdates_is_plugins_auto_update_enabled() ) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be sure to keep the test here in sync with the early exit test in wp_autoupdates_add_plugins_autoupdates_column_content().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch 👍

return $columns;
}
if ( ! isset( $_GET['plugin_status'] ) || ( 'mustuse' !== $_GET['plugin_status'] && 'dropins' !== $_GET['plugin_status'] ) ) {
$columns['autoupdates_column'] = __( 'Automatic updates', 'wp-autoupdates' );
}
Expand Down