Make WordPress Core


Ignore:
Timestamp:
07/25/2012 04:13:13 PM (10 years ago)
Author:
ryan
Message:

Fix per_page screen option for custom post types and taxonomies. Don't convert taxonomy and post type slugs from hyphen to underscore when saving the per_page usermeta. Props nacin. see #18958

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r20417 r21322  
    329329            return;
    330330
    331         $option = str_replace('-', '_', $option);
    332 
    333331        $map_option = $option;
    334332        $type = str_replace('edit_', '', $map_option);
    335333        $type = str_replace('_per_page', '', $type);
    336         if ( in_array($type, get_post_types()) )
     334        if ( in_array( $type, get_taxonomies() ) )
     335            $map_option = 'edit_tags_per_page';
     336        elseif ( in_array( $type, get_post_types() ) )
    337337            $map_option = 'edit_per_page';
    338         if ( in_array( $type, get_taxonomies()) )
    339             $map_option = 'edit_tags_per_page';
     338        else
     339            $option = str_replace('-', '_', $option);
    340340
    341341        switch ( $map_option ) {
Note: See TracChangeset for help on using the changeset viewer.