Make WordPress Core


Ignore:
Timestamp:
02/28/2010 07:37:24 AM (15 years ago)
Author:
dd32
Message:

Use get_terms() in wp_count_terms(). Props scribu. Fixes #10746

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tags.php

    r13450 r13491  
    231231}
    232232
    233 if ( !empty($_GET['s']) ) {
    234     $searchterms = trim(stripslashes($_GET['s']));
    235     $total_terms = count( get_terms( $taxonomy, array( 'search' => $searchterms, 'number' => 0, 'hide_empty' => 0 ) ) );
    236 } else {
    237     $searchterms = '';
    238     $total_terms = wp_count_terms($taxonomy);
    239 }
     233$searchterms = !empty($_GET['s']) ? trim(stripslashes($_GET['s'])) : '';
    240234
    241235$page_links = paginate_links( array(
     
    244238    'prev_text' => __('«'),
    245239    'next_text' => __('»'),
    246     'total' => ceil($total_terms / $tags_per_page),
     240    'total' => ceil(wp_count_terms($taxonomy, array('search' => $searchterms)) / $tags_per_page),
    247241    'current' => $pagenum
    248242));
Note: See TracChangeset for help on using the changeset viewer.