WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/06/2008 09:56:29 PM (13 years ago)
Author:
azaozz
Message:

Implementing new design for Edit Posts, Comments, etc. lists, props mdawaffe, see #8083

File:
1 edited

Legend:

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

    r9545 r9556  
    125125$status_links = array();
    126126$num_posts = wp_count_posts( 'post', 'readable' );
     127$total_posts = array_sum( (array) $num_posts );
    127128$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
    128 $status_links[] = "<li><a href='edit.php' $class>" . __('All Posts') . '</a>';
     129$status_links[] = "<li><a href='edit.php' $class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
     130
     131
    129132foreach ( $post_stati as $status => $label ) {
    130133    $class = '';
     
    138141        $class = ' class="current"';
    139142
    140     $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" .
    141     sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
    142 }
    143 echo implode( ' | </li>', $status_links ) . '</li>';
     143    $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
     144}
     145echo implode( " |</li>\n", $status_links ) . '</li>';
    144146unset( $status_links );
    145147endif;
     
    224226
    225227<?php if ( $page_links ) { ?>
    226 <div class="tablenav-pages"><?php echo $page_links; ?></div>
     228<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
     229    number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
     230    number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
     231    number_format_i18n( $wp_query->found_posts ),
     232    $page_links
     233); echo $page_links_text; ?></div>
    227234<?php } ?>
    228235
     
    243250<?php
    244251if ( $page_links )
    245     echo "<div class='tablenav-pages'>$page_links</div>";
     252    echo "<div class='tablenav-pages'>$page_links_text</div>";
    246253?>
    247254
Note: See TracChangeset for help on using the changeset viewer.