Changeset 5707 for trunk/wp-admin/edit.php
- Timestamp:
- 06/14/2007 04:24:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r5667 r5707 12 12 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 13 13 'future' => array(__('Scheduled'), __('Scheduled posts')), 14 'pending' => array(__('Pending Review'), __('Pending posts')), 14 15 'private' => array(__('Private'), __('Private posts')), 15 16 'publish' => array(__('Published'), __('Published posts')) 16 17 ); 18 19 $avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'"); 17 20 18 21 $post_status_q = ''; … … 31 34 32 35 // 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>'; 38 if ( !in_array($_GET['post_status'], array('pending', 'draft')) ) 39 $posts_columns['date'] = __('When'); 40 $posts_columns['title'] = __('Title'); 41 $posts_columns['categories'] = __('Categories'); 42 if ( 'publish' == $_GET['post_status'] ) 43 $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>'; 44 $posts_columns['author'] = __('Author'); 45 41 46 $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 42 47 … … 58 63 // Use $_GET instead of is_ since they can override each other 59 64 $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 } 63 73 } 64 74 $h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching “%s”'), wp_specialchars( get_search_query() ) ) : ''; … … 74 84 </fieldset> 75 85 76 <fieldset><legend><?php _e(' Post Type…'); ?></legend>86 <fieldset><legend><?php _e('Status…'); ?></legend> 77 87 <select name='post_status'> 78 88 <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; ?> 80 90 <option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option> 81 91 <?php endforeach; ?>
Note: See TracChangeset
for help on using the changeset viewer.