Ticket #5820: wp-admin-index.php.diff
| File wp-admin-index.php.diff, 2.6 kB (added by josephscott, 10 months ago) |
|---|
-
index.php
old new 37 37 <h3 class="reallynow"><?php _e('Right Now'); ?> <a href="post-new.php" class="rbutton"><?php _e('Write a New Post'); ?></a> <a href="page-new.php" class="rbutton"><?php _e('Write a New Page'); ?></a></h3> 38 38 39 39 <?php 40 $num_posts = wp_count_posts('post', 'publish'); 40 $num_posts = wp_count_posts( 'post' ); 41 $num_pages = wp_count_posts( 'page' ); 41 42 42 $num_pages = wp_count_posts('page', 'publish');43 44 $num_drafts = wp_count_posts('post', 'draft');45 46 $num_future = wp_count_posts('post', 'future');47 48 $num_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");49 50 43 $num_cats = wp_count_terms('category'); 51 44 52 45 $num_tags = wp_count_terms('post_tag'); 53 46 54 47 $post_type_texts = array(); 55 48 56 if ( $num_posts ) {57 $post_type_texts[] = '<a href="edit.php">'.sprintf( __ngettext( '%s post', '%s posts', $num_posts ), number_format_i18n( $num_posts) ).'</a>';49 if ( $num_posts['publish'] ) { 50 $post_type_texts[] = '<a href="edit.php">'.sprintf( __ngettext( '%s post', '%s posts', $num_posts['publish'] ), number_format_i18n( $num_posts['publish'] ) ).'</a>'; 58 51 } 59 if ( $num_pages ) {60 $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages ), number_format_i18n( $num_pages) ).'</a>';52 if ( $num_pages['publish'] ) { 53 $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages['publish'] ), number_format_i18n( $num_pages['publish'] ) ).'</a>'; 61 54 } 62 if ( $num_ drafts) {63 $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_ drafts ), number_format_i18n( $num_drafts) ).'</a>';55 if ( $num_posts['draft'] ) { 56 $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts['draft'] ), number_format_i18n( $num_posts['draft'] ) ).'</a>'; 64 57 } 65 if ( $num_ future) {66 $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_ future ), number_format_i18n( $num_future) ).'</a>';58 if ( $num_posts['future'] ) { 59 $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts['future'] ), number_format_i18n( $num_posts['future'] ) ).'</a>'; 67 60 } 68 61 69 62 $cats_text = '<a href="categories.php">'.sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) ).'</a>';
