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.
Built from https://develop.svn.wordpress.org/trunk@59727


git-svn-id: http://core.svn.wordpress.org/trunk@59069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2025-01-29 17:40:21 +00:00
parent 16a13a7f40
commit 7b5f5f727a
4 changed files with 14 additions and 2 deletions

View File

@ -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.

View File

@ -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',

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59726';
$wp_version = '6.8-alpha-59727';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.