mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Reduce queries by wp_count_posts(). Props josephscott. fixes #5820
git-svn-id: https://develop.svn.wordpress.org/trunk@6808 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+2
-2
@@ -52,18 +52,18 @@ if ( is_single() ) {
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts('post');
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
$class = '';
|
||||
|
||||
if ( !in_array($status, $avail_post_stati) )
|
||||
continue;
|
||||
|
||||
$num_posts = wp_count_posts('post', $status);
|
||||
if ( $status == $_GET['post_status'] )
|
||||
$class = ' class="current"';
|
||||
|
||||
$status_links[] = "<li><a href=\"edit.php?post_status=$status\"$class>" .
|
||||
sprintf($label[2], $num_posts) . '</a>';
|
||||
sprintf($label[2], $num_posts->$status) . '</a>';
|
||||
}
|
||||
$class = empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href=\"edit.php\"$class>All Posts</a>";
|
||||
|
||||
Reference in New Issue
Block a user