Make WordPress Core

Changeset 12995


Ignore:
Timestamp:
02/06/2010 05:51:24 PM (15 years ago)
Author:
ryan
Message:

Use canonical status list. see #9674

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r12733 r12995  
    21012101                $r_status[] = "$wpdb->posts.post_status <> 'trash'";
    21022102            } else {
    2103                 if ( in_array( 'draft'  , $q_status ) )
    2104                     $r_status[] = "$wpdb->posts.post_status = 'draft'";
    2105                 if ( in_array( 'pending', $q_status ) )
    2106                     $r_status[] = "$wpdb->posts.post_status = 'pending'";
    2107                 if ( in_array( 'future' , $q_status ) )
    2108                     $r_status[] = "$wpdb->posts.post_status = 'future'";
    2109                 if ( in_array( 'inherit' , $q_status ) )
    2110                     $r_status[] = "$wpdb->posts.post_status = 'inherit'";
    2111                 if ( in_array( 'private', $q_status ) )
    2112                     $p_status[] = "$wpdb->posts.post_status = 'private'";
    2113                 if ( in_array( 'publish', $q_status ) )
    2114                     $r_status[] = "$wpdb->posts.post_status = 'publish'";
    2115                 if ( in_array( 'trash', $q_status ) )
    2116                     $r_status[] = "$wpdb->posts.post_status = 'trash'";
     2103                foreach ( get_post_stati() as $status ) {
     2104                    if ( in_array( $status, $q_status ) )
     2105                        $r_status[] = "$wpdb->posts.post_status = '$status'";
     2106                }
    21172107            }
    21182108
Note: See TracChangeset for help on using the changeset viewer.