From 1f0aed81a66ea9adbd4f1c93ebb12489cc3d0c66 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Fri, 1 Oct 2021 18:38:52 +0000 Subject: [PATCH] Administration: Enable first and last page buttons in `WP_List_Table::pagination()`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the first and last page pagination buttons were disabled when on their next or previous page respectively. This commit removes that unnecessary logic to keep these buttons enabled and avoid confusion in the user's navigation workflow. New behavior: - When on page 2, the go to first page `«` button is enabled - When on the page before the last page, the go to last page `»` button is enabled Follow-up to [32948], [47219]. Props wp_kc, ronakganatra, knutsp, sabernhardt, Hareesh Pillai, audrasjb, hellofromTonya. Fixes #42763. git-svn-id: https://develop.svn.wordpress.org/trunk@51880 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-list-table.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 2cae7f695a..3a658b9ace 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -910,16 +910,10 @@ class WP_List_Table { $disable_first = true; $disable_prev = true; } - if ( 2 == $current ) { - $disable_first = true; - } if ( $total_pages == $current ) { $disable_last = true; $disable_next = true; } - if ( $total_pages - 1 == $current ) { - $disable_last = true; - } if ( $disable_first ) { $page_links[] = '';