WordPress.org

Make WordPress Core

Ticket #8632: 8632-pagination.diff

File 8632-pagination.diff, 784 bytes (added by Denis-de-Bernardy, 6 years ago)
  • wp-admin/categories.php

     
    166166        $cats_per_page = 20; 
    167167$cats_per_page = apply_filters('edit_categories_per_page', $cats_per_page); 
    168168 
     169if ( !empty($_GET['s']) ) 
     170        $num_cats = count(get_categories(array('hide_empty' => 0, 'search' => $_GET['s']))); 
     171else 
     172        $num_cats = wp_count_terms('category'); 
     173 
    169174$page_links = paginate_links( array( 
    170175        'base' => add_query_arg( 'pagenum', '%#%' ), 
    171176        'format' => '', 
    172177        'prev_text' => __('«'), 
    173178        'next_text' => __('»'), 
    174         'total' => ceil(wp_count_terms('category') / $cats_per_page), 
     179        'total' => ceil($num_cats / $cats_per_page), 
    175180        'current' => $pagenum 
    176181)); 
    177182