Make WordPress Core


Ignore:
Timestamp:
04/09/2008 08:09:45 PM (18 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r7614 r7638  
    507507
    508508function get_available_post_statuses($type = 'post') {
    509         global $wpdb;
    510 
    511         $stati = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = %s", $type));
    512         return $stati;
     509        $stati = wp_count_posts($type);
     510
     511        return array_keys(get_object_vars($stati));
    513512}
    514513
Note: See TracChangeset for help on using the changeset viewer.