From f022897182bc41af09e8d40328660acd861b955e Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 24 Jan 2010 02:07:13 +0000 Subject: [PATCH] Fix Tag paging number whilst searching. Fixes #11989 git-svn-id: https://develop.svn.wordpress.org/trunk@12816 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-tags.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 9392c4398d..555a01e1f2 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -200,12 +200,17 @@ if ( empty($tags_per_page) || $tags_per_page < 1 ) $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page ); $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter +if ( !empty($_GET['s']) ) + $total_terms = count( get_terms( $taxonomy, array( 'search' => trim(stripslashes($_GET['s'])), 'number' => 0, 'hide_empty' => 0 ) ) ); +else + $total_terms = wp_count_terms($taxonomy); + $page_links = paginate_links( array( 'base' => add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), - 'total' => ceil(wp_count_terms($taxonomy) / $tags_per_page), + 'total' => ceil($total_terms / $tags_per_page), 'current' => $pagenum )); @@ -310,7 +315,7 @@ else
-

+