Don't use array_fill_keys() as it is PHP5 only. see #9674

git-svn-id: https://develop.svn.wordpress.org/trunk@13199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-02-18 20:03:04 +00:00
parent f17505ed9f
commit b6cf7b637e
1 changed files with 4 additions and 1 deletions

View File

@ -1425,7 +1425,10 @@ function wp_count_posts( $type = 'post', $perm = '' ) {
$count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A );
$stats = array_fill_keys( get_post_stati(), 0);
$stats = array();
foreach ( get_post_stati() as $state )
$stats[$state] = 0;
foreach ( (array) $count as $row_num => $row )
$stats[$row['post_status']] = $row['num_posts'];