Skip to content

Commit

Permalink
Administration: Fix pagination in categories, tags, and plugins tables.
Browse files Browse the repository at this point in the history
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.

Built from https://develop.svn.wordpress.org/branches/6.7@59759


git-svn-id: http://core.svn.wordpress.org/branches/6.7@59101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
aaronjorbin committed Feb 4, 2025
1 parent 407857c commit 1a47005
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions wp-admin/edit-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@
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.
Expand Down
7 changes: 6 additions & 1 deletion wp-admin/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,12 @@ $( function() {

$( '.bulkactions' ).parents( 'form' ).on( 'submit', function( event ) {
var form = this,
submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false;
submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false,
currentPageSelector = form.querySelector( '#current-page-selector' );

if ( currentPageSelector && currentPageSelector.defaultValue !== currentPageSelector.value ) {
return; // Pagination form submission.
}

// Observe submissions from posts lists for 'bulk_action' or users lists for 'new_role'.
var bulkFieldRelations = {
Expand Down
Loading

0 comments on commit 1a47005

Please sign in to comment.