Make WordPress Core


Ignore:
Timestamp:
06/14/2007 04:24:28 PM (18 years ago)
Author:
markjaquith
Message:

Introducing post_status="pending". see #4446 and put any initial bug reports on that ticket

File:
1 edited

Legend:

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

    r5667 r5707  
    1212            'draft' => array(__('Draft'), _c('Drafts|manage posts header')),
    1313            'future' => array(__('Scheduled'), __('Scheduled posts')),
     14            'pending' => array(__('Pending Review'), __('Pending posts')),
    1415            'private' => array(__('Private'), __('Private posts')),
    1516            'publish' => array(__('Published'), __('Published posts'))
    1617        );
     18
     19$avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'");
    1720
    1821$post_status_q = '';
     
    3134
    3235// define the columns to display, the syntax is 'internal name' => 'display name'
    33 $posts_columns = array(
    34     'id'         => '<div style="text-align: center">' . __('ID') . '</div>',
    35     'date'       => __('When'),
    36     'title'      => __('Title'),
    37     'categories' => __('Categories'),
    38     'comments'   => '<div style="text-align: center">' . __('Comments') . '</div>',
    39     'author'     => __('Author')
    40 );
     36$posts_columns = array();
     37$posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>';
     38if ( !in_array($_GET['post_status'], array('pending', 'draft')) )
     39    $posts_columns['date'] = __('When');
     40$posts_columns['title'] = __('Title');
     41$posts_columns['categories'] = __('Categories');
     42if ( 'publish' == $_GET['post_status'] )
     43    $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>';
     44$posts_columns['author'] = __('Author');
     45
    4146$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
    4247
     
    5863    // Use $_GET instead of is_ since they can override each other
    5964    $h2_author = '';
    60     if ( isset($_GET['author']) && $_GET['author'] ) {
    61         $author_user = get_userdata( get_query_var( 'author' ) );
    62         $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
     65    $_GET['author'] = (int) $_GET['author'];
     66    if ( $_GET['author'] != 0 ) {
     67        if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion
     68            $h2_author = ' ' . __('by other authors');
     69        } else {
     70            $author_user = get_userdata( get_query_var( 'author' ) );
     71            $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
     72        }
    6373    }
    6474    $h2_search = isset($_GET['s'])   && $_GET['s']   ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( get_search_query() ) ) : '';
     
    7484    </fieldset>
    7585
    76     <fieldset><legend><?php _e('Post Type&hellip;'); ?></legend>
     86    <fieldset><legend><?php _e('Status&hellip;'); ?></legend>
    7787        <select name='post_status'>
    7888            <option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
    79 <?php   foreach ( $post_stati as $status => $label ) : ?>
     89<?php   foreach ( $post_stati as $status => $label ) : if ( !in_array($status, $avail_post_stati) ) continue; ?>
    8090            <option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option>
    8191<?php   endforeach; ?>
Note: See TracChangeset for help on using the changeset viewer.