diff options
author | Joe Dolson <joedolson@git.wordpress.org> | 2025-01-29 17:38:49 +0000 |
---|---|---|
committer | Joe Dolson <joedolson@git.wordpress.org> | 2025-01-29 17:38:49 +0000 |
commit | 382211aef258a972d34beab0dc9f653db7dd5978 (patch) | |
tree | 26432f97e2eefb6ef645d8db6ec674922b7aec52 | |
parent | 8246f316e48b47af4ab177cdc1b1891f5150009f (diff) | |
download | wordpress-382211aef258a972d34beab0dc9f653db7dd5978.tar.gz wordpress-382211aef258a972d34beab0dc9f653db7dd5978.zip |
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.
Props ffffelix, im3dabasia1, apermo, rishavdutta, joedolson, swissspidy, jorbin, joedolson.
Fixes #62534.
git-svn-id: https://develop.svn.wordpress.org/trunk@59727 602fd350-edb4-49c9-b593-d223f7449a82
-rw-r--r-- | src/js/_enqueues/admin/common.js | 9 | ||||
-rw-r--r-- | src/wp-admin/edit-tags.php | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js index 1aa35a37db..c7415d02c3 100644 --- a/src/js/_enqueues/admin/common.js +++ b/src/js/_enqueues/admin/common.js @@ -1310,10 +1310,19 @@ $( function() { $document.trigger( 'wp-notice-added' ); }; + // Stores initial pagination value for comparison. + var initialPagedValue = document.querySelector( '#current-page-selector' ).value; + $( '.bulkactions' ).parents( 'form' ).on( 'submit', function( event ) { var form = this, submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false; + var currentPagedValue = form.querySelector( '#current-page-selector' ).value; + + if ( initialPagedValue !== currentPagedValue ) { + return; // Pagination form submission. + } + // Observe submissions from posts lists for 'bulk_action' or users lists for 'new_role'. var bulkFieldRelations = { 'bulk_action' : 'action', diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php index a0a38d917d..74381c0ec8 100644 --- a/src/wp-admin/edit-tags.php +++ b/src/wp-admin/edit-tags.php @@ -216,6 +216,9 @@ if ( $location ) { if ( $pagenum > 1 ) { $location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages. } + if ( 1 === $pagenum ) { + $location = remove_query_arg( 'paged', $location ); + } /** * Filters the taxonomy redirect destination URL. |