WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/13/2010 06:49:56 PM (11 years ago)
Author:
ryan
Message:

register_post_type(). see #9674

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin

    • Property svn:ignore deleted
  • trunk/wp-admin/includes/post.php

    r12707 r12719  
    818818    $q['m'] = isset($q['m']) ? (int) $q['m'] : 0;
    819819    $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
    820     $post_stati  = array(   //  array( adj, noun )
    821                 'publish' => array(_x('Published', 'post'), __('Published posts'), _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')),
    822                 'future' => array(_x('Scheduled', 'post'), __('Scheduled posts'), _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')),
    823                 'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
    824                 'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
    825                 'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
    826                 'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')),
    827             );
    828 
    829     $post_stati = apply_filters('post_stati', $post_stati);
     820    $post_stati  = get_post_stati();
    830821
    831822    if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types( array('_show' => true) ) ) )
     
    836827    $avail_post_stati = get_available_post_statuses($post_type);
    837828
    838     if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) {
     829    if ( isset($q['post_status']) && in_array( $q['post_status'], $post_stati ) ) {
    839830        $post_status = $q['post_status'];
    840831        $perm = 'readable';
     
    863854    wp( compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page') );
    864855
    865     return array($post_stati, $avail_post_stati);
     856    return $avail_post_stati;
    866857}
    867858
Note: See TracChangeset for help on using the changeset viewer.