1 <?php if ( ! defined('ABSPATH') ) die(); ?>
2 <table class="widefat">
6 <?php $posts_columns = wp_manage_posts_columns(); ?>
7 <?php foreach($posts_columns as $post_column_key => $column_display_name) {
8 if ( 'cb' === $post_column_key )
9 $class = ' class="check-column"';
10 elseif ( 'comments' === $post_column_key )
11 $class = ' class="num"';
15 <th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th>
24 add_filter('the_title','wp_specialchars');
26 // Create array of post IDs.
28 foreach ( $wp_query->posts as $a_post )
29 $post_ids[] = $a_post->ID;
31 $comment_pending_count = get_pending_comments_num($post_ids);
33 while (have_posts()) : the_post();
34 $class = 'alternate' == $class ? '' : 'alternate';
36 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
37 $title = get_the_title();
39 $title = __('(no title)');
41 <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
45 foreach($posts_columns as $column_name=>$column_display_name) {
47 switch($column_name) {
51 <th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /><?php } ?></th>
56 if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
57 $t_time = $h_time = __('Unpublished');
59 if ( 'modified' == $column_name ) {
60 $t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
61 $m_time = $post->post_modified;
62 $time = get_post_modified_time('G', true);
64 $t_time = get_the_time(__('Y/m/d g:i:s A'));
65 $m_time = $post->post_date;
66 $time = get_post_time('G', true);
68 if ( ( abs(time() - $time) ) < 86400 ) {
69 if ( ( 'future' == $post->post_status) )
70 $h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
72 $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
74 $h_time = mysql2date(__('Y/m/d'), $m_time);
78 <td><abbr title="<?php echo $t_time ?>"><?php echo apply_filters('post_date_column_time', $h_time, $post, $column_name) ?></abbr></td>
83 <td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="post.php?action=edit&post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
84 <?php if ( !empty($post->post_password) ) { _e(' — <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' — <strong>Private</strong>'); } ?></td>
91 $categories = get_the_category();
92 if ( !empty( $categories ) ) {
94 foreach ( $categories as $c )
95 $out[] = "<a href='edit.php?category_name=$c->slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
96 echo join( ', ', $out );
107 $tags = get_the_tags();
108 if ( !empty( $tags ) ) {
110 foreach ( $tags as $c )
111 $out[] = "<a href='edit.php?tag=$c->slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
112 echo join( ', ', $out );
122 <td class="num"><div class="post-com-count-wrapper">
124 $left = isset($comment_pending_count) ? $comment_pending_count[$post->ID] : 0;
125 $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
128 comments_number("<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
138 <td><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
145 <a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">
147 switch ( $post->post_status ) {
156 _e('Pending Review');
170 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
176 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
180 case 'control_delete':
182 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>
188 <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
199 <tr style='background-color: <?php echo $bgcolor; ?>'>
200 <td colspan="8"><?php _e('No posts found.') ?></td>
203 } // end if ( have_posts() )