Skip to content

Commit 9f820be

Browse files
Administration: Adjust tag count handling for pagination consistency
1 parent 0577a55 commit 9f820be

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/js/_enqueues/admin/tags.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jQuery( function($) {
5656
$('p.search-box').hide();
5757
}
5858

59-
var itemCount = $('#the-list tr').length;
59+
var currentCount = parseInt( $('.tablenav-pages .displaying-num').first().text().match(/\d+/) ) || 0;
60+
var itemCount = currentCount - 1 || 0;
6061
var itemText = itemCount === 1 ? wp.i18n.__('item') : wp.i18n.__('items');
6162
$('.tablenav-pages .displaying-num').text( itemCount + ' ' + itemText);
6263
});
@@ -177,7 +178,8 @@ jQuery( function($) {
177178

178179
$('input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):visible, textarea:visible', form).val('');
179180

180-
var itemCount = $('#the-list tr').length;
181+
var currentCount = parseInt( $('.tablenav-pages .displaying-num').first().text().match(/\d+/) ) || 0;
182+
var itemCount = currentCount + 1 || 0;
181183
var itemText = itemCount === 1 ? wp.i18n.__('item') : wp.i18n.__('items');
182184
$('.tablenav-pages .displaying-num').text( itemCount + ' ' + itemText);
183185

0 commit comments

Comments
 (0)