WordPress.org

Make WordPress Core

Changeset 13081


Ignore:
Timestamp:
02/13/2010 03:52:33 AM (12 years ago)
Author:
dd32
Message:

Fix Terms Per Page for taxonomies, Apply old Category filter to value. See #11838

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r13077 r13081  
    197197    $pagenum = 1;
    198198
    199 $tags_per_page = (int) get_user_option( 'edit_tags_per_page' );
     199if ( 'post_tag' == $taxonomy )
     200    $tags_per_page = (int) get_user_option( 'edit_tags_per_page' );
     201elseif ( 'category' == $taxonomy )
     202    $tags_per_page = (int) get_user_option( 'categories_per_page' );
     203else
     204    $tags_per_page = (int) get_user_option( 'edit_' .  $taxonomy . '_per_page' );
     205
    200206if ( empty($tags_per_page) || $tags_per_page < 1 )
    201207    $tags_per_page = 20;
    202 $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
    203 $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
     208
     209if ( 'post_tag' == $taxonomy ) {
     210    $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
     211    $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
     212} elseif ( 'category' == $taxonomy ) {
     213    $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
     214} else {
     215    $tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
     216}
    204217
    205218if ( !empty($_GET['s']) ) {
  • trunk/wp-admin/includes/template.php

    r13079 r13081  
    36393639            $per_page_label = __('Media items per page:');
    36403640            break;
    3641         case 'categories':
    3642             $per_page_label = __('Categories per page:');
    3643             break;
    36443641        case 'edit-tags':
    3645             $per_page_label = __('Tags per page:');
     3642            global $taxonomy, $tax;
     3643            if ( 'post_tag' == $taxonomy )
     3644                $per_page_label = __('Tags per page:');
     3645            elseif ( 'category' == $taxonomy )
     3646                $per_page_label = __('Categories per page:');
     3647            else
     3648                $per_page_label = sprintf(_x('%s per page:', '%s: plural taxonomy name'), $tax->label);
    36463649            break;
    36473650        case 'plugins':
     
    36533656
    36543657    $option = str_replace( '-', '_', "{$screen->id}_per_page" );
     3658    if ( 'edit_tags_per_page' == $option ) {
     3659        if ( 'category' == $taxonomy )
     3660            $option = 'categories_per_page';
     3661        elseif ( 'post_tag' != $taxonomy )
     3662            $option = 'edit_' . $taxonomy . '_per_page';
     3663    }
     3664
    36553665    $per_page = (int) get_user_option( $option );
    36563666    if ( empty( $per_page ) || $per_page < 1 ) {
     
    36603670            $per_page = 20;
    36613671    }
     3672
    36623673    if ( 'edit_comments_per_page' == $option )
    36633674        $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
    3664     elseif ( 'categories' == $option )
     3675    elseif ( 'categories_per_page' == $option )
    36653676        $per_page = apply_filters( 'edit_categories_per_page', $per_page );
    36663677    else
Note: See TracChangeset for help on using the changeset viewer.