Make WordPress Core


Ignore:
Timestamp:
02/13/2008 09:30:26 AM (19 years ago)
Author:
ryan
Message:

Reduce queries by wp_count_posts(). Props josephscott. fixes #5820

File:
1 edited

Legend:

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

    r6807 r6808  
    5353<?php
    5454$status_links = array();
     55$num_posts = wp_count_posts('post');
    5556foreach ( $post_stati as $status => $label ) {
    5657        $class = '';
     
    5960                continue;
    6061
    61         $num_posts = wp_count_posts('post', $status);
    6262        if ( $status == $_GET['post_status'] )
    6363                $class = ' class="current"';
    6464
    6565        $status_links[] = "<li><a href=\"edit.php?post_status=$status\"$class>" .
    66         sprintf($label[2], $num_posts) . '</a>';
     66        sprintf($label[2], $num_posts->$status) . '</a>';
    6767}
    6868$class = empty($_GET['post_status']) ? ' class="current"' : '';
Note: See TracChangeset for help on using the changeset viewer.