From 0c990ffb734d350208149ae15c190f4190597995 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Thu, 9 Jun 2016 01:55:40 +0000 Subject: [PATCH] Users: Stop WP_List_Table notices from persisting on pagination navigation. Adds the keyboard navigation query vars to `wp_removable_query_args()` and passes the results of said function to remove_query_var() inside the WP_List_Table pagination method. Props EFAREM for the initial patch. Fixes #35620. git-svn-id: https://develop.svn.wordpress.org/trunk@37663 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-list-table.php | 3 ++- src/wp-includes/functions.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 60a4b31f9b..d197a6a40d 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -763,10 +763,11 @@ class WP_List_Table { $output = '' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . ''; $current = $this->get_pagenum(); + $removable_query_args = wp_removable_query_args(); $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); - $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url ); + $current_url = remove_query_arg( $removable_query_args, $current_url ); $page_links = array(); diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index cec338693e..f64a226ba4 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -865,6 +865,8 @@ function wp_removable_query_args() { 'disabled', 'enabled', 'error', + 'hotkeys_highlight_first', + 'hotkeys_highlight_last', 'locked', 'message', 'same',