Make WordPress Core

Changeset 59759


Ignore:
Timestamp:
02/04/2025 03:24:19 AM (12 days ago)
Author:
jorbin
Message:

Administration: Fix pagination in categories, tags, and plugins tables.

Fix an issue introduced in [59134] that prevented manual entry of a page number in the pagination input field from navigating pages. Requiring validation of the bulk actions input also impacted other inputs nested in the same form.

Also fixes a pre-existing bug where it was not possible to navigate to page 1 using the input field.

Reviewed by jorbin.
Merges [59727] and [59746] to the 6.7 branch.

Props ffffelix, im3dabasia1, apermo, rishavdutta, joedolson, swissspidy, jorbin, joedolson, tobiasbg, mamaduka.
Fixes #62534.

Location:
branches/6.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/6.7

  • branches/6.7/src/js/_enqueues/admin/common.js

    r59134 r59759  
    13131313    $( '.bulkactions' ).parents( 'form' ).on( 'submit', function( event ) {
    13141314        var form = this,
    1315             submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false;
     1315            submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false,
     1316            currentPageSelector = form.querySelector( '#current-page-selector' );
     1317
     1318        if ( currentPageSelector && currentPageSelector.defaultValue !== currentPageSelector.value ) {
     1319            return; // Pagination form submission.
     1320        }
    13161321
    13171322        // Observe submissions from posts lists for 'bulk_action' or users lists for 'new_role'.
  • branches/6.7/src/wp-admin/edit-tags.php

    r58918 r59759  
    216216    if ( $pagenum > 1 ) {
    217217        $location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages.
     218    }
     219    if ( 1 === $pagenum ) {
     220        $location = remove_query_arg( 'paged', $location );
    218221    }
    219222
Note: See TracChangeset for help on using the changeset viewer.