From b6cf7b637e15c8cdfc6652f58a939c50907501ba Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 18 Feb 2010 20:03:04 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index b51ba49f54..af4b12eaa1 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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'];