Use wp_count_posts() to determine availabel statuses for get_available_post_statuses(). fixes #6654 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@7638 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-04-09 20:09:45 +00:00
parent 357e5567c7
commit a9d89696f3
2 changed files with 19 additions and 5 deletions
+2 -3
View File
@@ -506,10 +506,9 @@ function _relocate_children( $old_ID, $new_ID ) {
}
function get_available_post_statuses($type = 'post') {
global $wpdb;
$stati = wp_count_posts($type);
$stati = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = %s", $type));
return $stati;
return array_keys(get_object_vars($stati));
}
function wp_edit_posts_query( $q = false ) {