diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index 5aed07a8fd..e1d42527dd 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -64,7 +64,12 @@ function wp_get_single_post($postid = 0, $mode = OBJECT) { $result = $wpdb->get_row($sql, $mode); // Set categories - $result['post_category'] = wp_get_post_cats('',$postid); + if($mode == OBJECT) { + $result->post_category = wp_get_post_cats('',$postid); + } + else { + $result['post_category'] = wp_get_post_cats('',$postid); + } return $result; }