From ffee12605e64fde029c7304b74d97beb11b7e427 Mon Sep 17 00:00:00 2001 From: Paul Biron Date: Thu, 14 May 2020 08:27:29 -0600 Subject: [PATCH 1/3] Fix incorrect admin notice text when auto-updates are enabled for a plugin when JS is not enabled in the browser. No equivalent problem exists for disabling plugin auto-updates nor on either the multisite or non-multisite themes screens. --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index a67dc06..15d444b 100755 --- a/functions.php +++ b/functions.php @@ -363,7 +363,7 @@ function wp_autoupdates_handle_plugins_enable_disable() { update_site_option( 'wp_auto_update_plugins', $auto_updates ); - wp_redirect( self_admin_url( "plugins.php?disable-auto-update=true&plugin_status=$status&paged=$page&s=$s" ) ); + wp_redirect( self_admin_url( "plugins.php?enable-auto-update=true&plugin_status=$status&paged=$page&s=$s" ) ); exit; } elseif ( 'disable-auto-update' === $_GET['action'] ) { if ( ! current_user_can( 'update_plugins' ) || ! wp_autoupdates_is_plugins_auto_update_enabled() ) { From 444f08280c04a1f19399bfe4d39fc186b5b6dabf Mon Sep 17 00:00:00 2001 From: Andrew Ozz <743931+azaozz@users.noreply.github.com> Date: Sat, 16 May 2020 14:37:54 -0700 Subject: [PATCH 2/3] Bind the 'click' handler to document FIxes it to work after replacing the list-table on plugin search. --- js/wp-autoupdates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/wp-autoupdates.js b/js/wp-autoupdates.js index 52b84c7..f95382a 100644 --- a/js/wp-autoupdates.js +++ b/js/wp-autoupdates.js @@ -6,9 +6,9 @@ 'use strict'; $( document ).ready( function() { - $( '.column-auto-updates, .theme-overlay' ).on( + $( document ).on( 'click', - '.toggle-auto-update', + 'a.toggle-auto-update', function( event ) { var data, asset, type, $anchor = $( this ), From b3a692c6793e096c08e984c573919c21285f7d65 Mon Sep 17 00:00:00 2001 From: Andrew Ozz <743931+azaozz@users.noreply.github.com> Date: Sat, 16 May 2020 15:38:08 -0700 Subject: [PATCH 3/3] Make the click target more specific Chatting with @pbiron, this looks better. --- js/wp-autoupdates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/wp-autoupdates.js b/js/wp-autoupdates.js index f95382a..034643b 100644 --- a/js/wp-autoupdates.js +++ b/js/wp-autoupdates.js @@ -8,7 +8,7 @@ $( document ).ready( function() { $( document ).on( 'click', - 'a.toggle-auto-update', + '.column-auto-updates a.toggle-auto-update, .theme-overlay a.toggle-auto-update', function( event ) { var data, asset, type, $anchor = $( this ),