Make WordPress Core


Ignore:
Timestamp:
01/15/2010 04:58:36 PM (15 years ago)
Author:
ryan
Message:

Merge edit-pages.php into edit.php. see #9674

File:
1 edited

Legend:

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

    r12719 r12728  
    820820    $post_stati  = get_post_stati();
    821821
    822     if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types( array('_show' => true) ) ) )
     822    if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types() ) )
    823823        $post_type = $q['post_type'];
    824824    else
    825825        $post_type = 'post';
     826    $post_type_object = get_post_type_object($post_type);
    826827
    827828    $avail_post_stati = get_available_post_statuses($post_type);
     
    843844    }
    844845
    845     if ( 'post' != $post_type )
    846         $per_page = 'edit_' . $post_type . '_per_page';
    847     else
    848         $per_page = 'edit_per_page';
    849     $posts_per_page = (int) get_user_option( 'edit_per_page' );
     846    $per_page = 'edit_' . $post_type . '_per_page';
     847    $posts_per_page = (int) get_user_option( $per_page );
    850848    if ( empty( $posts_per_page ) || $posts_per_page < 1 )
    851849        $posts_per_page = 15;
    852     $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
    853 
    854     wp( compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page') );
     850    $posts_per_page = apply_filters( $per_page, $posts_per_page );
     851
     852
     853    $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
     854
     855    // Hierarchical types require special args.
     856    if ( $post_type_object->hierarchical ) {
     857        $query['orderby'] = 'menu_order title';
     858        $query['order'] = 'asc';
     859        $query['posts_per_page'] = -1;
     860        $query['posts_per_archive_page'] = -1;
     861    }
     862
     863    wp( $query );
    855864
    856865    return $avail_post_stati;
Note: See TracChangeset for help on using the changeset viewer.