From 803eab428d54755acf83403a49bb1cb9c3663c13 Mon Sep 17 00:00:00 2001 From: adamsilverstein Date: Fri, 5 Jun 2020 21:11:02 +0000 Subject: [PATCH] Media: remove any `attachment-filter` query param when switching views. Fix an issue where the media attachment filter no longer worked after switching to list view, filtering by a media type then switching back to the grid view. Props itzmekhokan, netsurfer2705, zodiac1978. Fixes #43656. git-svn-id: https://develop.svn.wordpress.org/trunk@47915 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-list-table.php | 2 +- 1 file changed, 1 insertion(+), 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 791ee7c159..11cde8edcb 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -640,7 +640,7 @@ class WP_List_Table { } printf( "%s\n", - esc_url( add_query_arg( 'mode', $mode ) ), + esc_url( remove_query_arg( 'attachment-filter', add_query_arg( 'mode', $mode ) ) ), implode( ' ', $classes ), $title );