Fix Tag paging number whilst searching. Fixes #11989
git-svn-id: http://svn.automattic.com/wordpress/trunk@12816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
29bafc4bac
commit
5d46993b15
|
@ -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( 'edit_tags_per_page', $tags_per_page );
|
||||||
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
$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(
|
$page_links = paginate_links( array(
|
||||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||||
'format' => '',
|
'format' => '',
|
||||||
'prev_text' => __('«'),
|
'prev_text' => __('«'),
|
||||||
'next_text' => __('»'),
|
'next_text' => __('»'),
|
||||||
'total' => ceil(wp_count_terms($taxonomy) / $tags_per_page),
|
'total' => ceil($total_terms / $tags_per_page),
|
||||||
'current' => $pagenum
|
'current' => $pagenum
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue