From 8e10d3dce0745373c0d3cdde0e841fc78ccf24c3 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@13199 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 b51ba49f5..af4b12eaa 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'];