diff --git a/wp-admin/edit-post-rows.php b/wp-admin/edit-post-rows.php index 58a3271b3..c6fcd3cb1 100644 --- a/wp-admin/edit-post-rows.php +++ b/wp-admin/edit-post-rows.php @@ -29,204 +29,10 @@ if ( ! defined('ABSPATH') ) die(); posts as $a_post ) - $post_ids[] = $a_post->ID; - -$comment_pending_count = get_pending_comments_num($post_ids); - -while (have_posts()) : the_post(); -$class = 'alternate' == $class ? '' : 'alternate'; -global $current_user; -$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); -$edit_link = get_edit_post_link( $post->ID ); -$title = get_the_title(); -if ( empty($title) ) - $title = __('(no title)'); -?> - post_status ); ?>' valign="top"> - -$column_display_name) { - - switch($column_name) { - - case 'cb': - ?> - ID ) ) { ?> - post_date && 'date' == $column_name ) { - $t_time = $h_time = __('Unpublished'); - } else { - if ( 'modified' == $column_name ) { - $t_time = get_the_modified_time(__('Y/m/d g:i:s A')); - $m_time = $post->post_modified; - $time = get_post_modified_time('G', true); - } else { - $t_time = get_the_time(__('Y/m/d g:i:s A')); - $m_time = $post->post_date; - $time = get_post_time('G', true); - } - if ( ( abs(time() - $time) ) < 86400 ) { - if ( ( 'future' == $post->post_status) ) - $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); - else - $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); - } else { - $h_time = mysql2date(__('Y/m/d'), $m_time); - } - } - - if ( 'excerpt' == $mode ) : ?> - - - - - ID ) ) { ?>"> - post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } - - if ( 'excerpt' == $mode ) - the_excerpt(); - - $actions = array(); - $actions['edit'] = '' . __('Edit') . ''; - $actions['delete'] = "post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; - $action_count = count($actions); - $i = 0; - foreach ( $actions as $action => $link ) { - ++$i; - ( $i == $action_count ) ? $sep = '' : $sep = ' | '; - echo "$link$sep"; - } - ?> - - - slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . ""; - echo join( ', ', $out ); - } else { - _e('Uncategorized'); - } - ?> - - slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; - echo join( ', ', $out ); - } else { - _e('No Tags'); - } - ?> - -
- ID] : 0; - $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); - if ( $left ) - echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); - if ( $left ) - echo ''; - ?> -
- - - - - " rel="permalink"> - post_status ) { - case 'publish' : - case 'private' : - _e('Published'); - break; - case 'future' : - _e('Scheduled'); - break; - case 'pending' : - _e('Pending Review'); - break; - case 'draft' : - _e('Unpublished'); - break; - } - ?> - - - - - - ID) ) { echo "" . __('Edit') . ""; } ?> - - ID) ) { echo "ID) . "' class='delete'>" . __('Delete') . ""; } ?> - - - - - - + posts as $a_post ) + $post_ids[] = $a_post->ID; + + $comment_pending_count = get_pending_comments_num($post_ids); + if ( empty($comment_pending_count[$post->ID]) ) + $comment_pending_count = array(); + + while ( have_posts() ) { + the_post(); + + if ( empty($comment_pending_count[$post->ID]) ) + $comment_pending_count[$post->ID] = 0; + + _post_row($post, $comment_pending_count[$post->ID], $mode); + } +} + +function _post_row($a_post, $pending_comments, $mode) { + global $post; + static $class; + + $global_post = $post; + $post = $a_post; + + $class = 'alternate' == $class ? '' : 'alternate'; + global $current_user; + $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); + $edit_link = get_edit_post_link( $post->ID ); + $title = get_the_title(); + if ( empty($title) ) + $title = __('(no title)'); +?> + post_status ); ?>' valign="top"> +$column_display_name) { + + switch($column_name) { + + case 'cb': + ?> + ID ) ) { ?> + post_date && 'date' == $column_name ) { + $t_time = $h_time = __('Unpublished'); + } else { + if ( 'modified' == $column_name ) { + $t_time = get_the_modified_time(__('Y/m/d g:i:s A')); + $m_time = $post->post_modified; + $time = get_post_modified_time('G', true); + } else { + $t_time = get_the_time(__('Y/m/d g:i:s A')); + $m_time = $post->post_date; + $time = get_post_time('G', true); + } + if ( ( abs(time() - $time) ) < 86400 ) { + if ( ( 'future' == $post->post_status) ) + $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); + else + $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); + } else { + $h_time = mysql2date(__('Y/m/d'), $m_time); + } + } + + if ( 'excerpt' == $mode ) { ?> + + + + + ID ) ) { ?>"> + post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } + + if ( 'excerpt' == $mode ) + the_excerpt(); + + $actions = array(); + $actions['edit'] = '' . __('Edit') . ''; + $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $action_count = count($actions); + $i = 0; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + echo "$link$sep"; + } + ?> + + + slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . ""; + echo join( ', ', $out ); + } else { + _e('Uncategorized'); + } + ?> + + slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; + echo join( ', ', $out ); + } else { + _e('No Tags'); + } + ?> + +
+ '; + comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + if ( $pending_comments ) + echo ''; + ?> +
+ + + + + " rel="permalink"> + post_status ) { + case 'publish' : + case 'private' : + _e('Published'); + break; + case 'future' : + _e('Scheduled'); + break; + case 'pending' : + _e('Pending Review'); + break; + case 'draft' : + _e('Unpublished'); + break; + } + ?> + + + + + + ID) ) { echo "" . __('Edit') . ""; } ?> + + ID) ) { echo "ID) . "' class='delete'>" . __('Delete') . ""; } ?> + + ID); ?> + + +