Don't use array_fill_keys() as it is PHP5 only. see #9674
git-svn-id: http://svn.automattic.com/wordpress/trunk@13199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
71b350a317
commit
8e10d3dce0
|
@ -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'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue