WordPress.org

Make WordPress Core

Changeset 12707


Ignore:
Timestamp:
01/12/10 15:41:10 (4 years ago)
Author:
ryan
Message:

Allow per_page settings for custom post type edit screens. see #9674

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r12547 r12707  
    400400        $option = str_replace('-', '_', $option); 
    401401 
    402         switch ( $option ) { 
     402        $map_option = $option; 
     403        $type = str_replace('edit_', '', $map_option); 
     404        $type = str_replace('_per_page', '', $type); 
     405        if ( in_array($type, get_post_types()) ) 
     406            $map_option = 'edit_per_page'; 
     407 
     408        switch ( $map_option ) { 
    403409            case 'edit_per_page': 
    404410            case 'edit_pages_per_page': 
  • trunk/wp-admin/includes/post.php

    r12706 r12707  
    852852    } 
    853853 
     854    if ( 'post' != $post_type ) 
     855        $per_page = 'edit_' . $post_type . '_per_page'; 
     856    else 
     857        $per_page = 'edit_per_page'; 
    854858    $posts_per_page = (int) get_user_option( 'edit_per_page' ); 
    855859    if ( empty( $posts_per_page ) || $posts_per_page < 1 ) 
Note: See TracChangeset for help on using the changeset viewer.