WordPress.org

Make WordPress Core

Changeset 10908


Ignore:
Timestamp:
04/10/2009 09:47:01 PM (9 years ago)
Author:
ryan
Message:

Add per page screen option for categories

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r10905 r10908  
    10411041        case 'edit_comments_per_page':
    10421042        case 'upload_per_page':
     1043        case 'categories_per_page':
    10431044            $value = (int) $value;
    10441045            if ( $value < 1 || $value > 999 )
  • trunk/wp-admin/categories.php

    r10348 r10908  
    161161if ( empty($pagenum) )
    162162    $pagenum = 1;
    163 if( ! isset( $catsperpage ) || $catsperpage < 0 )
    164     $catsperpage = 20;
     163
     164$cats_per_page = get_user_option('categories_per_page');
     165if ( empty($cats_per_page) )
     166    $cats_per_page = 20;
     167$cats_per_page = apply_filters('edit_categories_per_page', $cats_per_page);
    165168
    166169$page_links = paginate_links( array(
     
    169172    'prev_text' => __('&laquo;'),
    170173    'next_text' => __('&raquo;'),
    171     'total' => ceil(wp_count_terms('category') / $catsperpage),
     174    'total' => ceil(wp_count_terms('category') / $cats_per_page),
    172175    'current' => $pagenum
    173176));
     
    206209    <tbody id="the-list" class="list:cat">
    207210<?php
    208 cat_rows(0, 0, 0, $pagenum, $catsperpage);
     211cat_rows(0, 0, 0, $pagenum, $cats_per_page);
    209212?>
    210213    </tbody>
  • trunk/wp-admin/includes/template.php

    r10903 r10908  
    35243524            $per_page_label = __('Media items per page:');
    35253525            break;
     3526        case 'categories':
     3527            $per_page_label = __('Categories per page:');
     3528            break;
    35263529        default:
    35273530            return '';
Note: See TracChangeset for help on using the changeset viewer.