Make WordPress Core


Ignore:
Timestamp:
12/01/2009 08:14:42 AM (17 years ago)
Author:
azaozz
Message:

Don't show deleted Pages in wp.getPages results, props ryan, props Denis-de-Bernardy,fixes #11243

File:
1 edited

Legend:

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

    r12146 r12303  
    21092109                        $r_status = array();
    21102110                        $p_status = array();
    2111                         if ( in_array( 'draft'  , $q_status ) )
    2112                                 $r_status[] = "$wpdb->posts.post_status = 'draft'";
    2113                         if ( in_array( 'pending', $q_status ) )
    2114                                 $r_status[] = "$wpdb->posts.post_status = 'pending'";
    2115                         if ( in_array( 'future' , $q_status ) )
    2116                                 $r_status[] = "$wpdb->posts.post_status = 'future'";
    2117                         if ( in_array( 'inherit' , $q_status ) )
    2118                                 $r_status[] = "$wpdb->posts.post_status = 'inherit'";
    2119                         if ( in_array( 'private', $q_status ) )
    2120                                 $p_status[] = "$wpdb->posts.post_status = 'private'";
    2121                         if ( in_array( 'publish', $q_status ) )
    2122                                 $r_status[] = "$wpdb->posts.post_status = 'publish'";
    2123                         if ( in_array( 'trash', $q_status ) )
    2124                                 $r_status[] = "$wpdb->posts.post_status = 'trash'";
     2111                        if ( $q['post_status'] == 'any' ) {
     2112                                // @todo Use register_post_status() data to determine which states should be excluded.
     2113                                $r_status[] = "$wpdb->posts.post_status <> 'trash'";
     2114                        } else {
     2115                                if ( in_array( 'draft'  , $q_status ) )
     2116                                        $r_status[] = "$wpdb->posts.post_status = 'draft'";
     2117                                if ( in_array( 'pending', $q_status ) )
     2118                                        $r_status[] = "$wpdb->posts.post_status = 'pending'";
     2119                                if ( in_array( 'future' , $q_status ) )
     2120                                        $r_status[] = "$wpdb->posts.post_status = 'future'";
     2121                                if ( in_array( 'inherit' , $q_status ) )
     2122                                        $r_status[] = "$wpdb->posts.post_status = 'inherit'";
     2123                                if ( in_array( 'private', $q_status ) )
     2124                                        $p_status[] = "$wpdb->posts.post_status = 'private'";
     2125                                if ( in_array( 'publish', $q_status ) )
     2126                                        $r_status[] = "$wpdb->posts.post_status = 'publish'";
     2127                                if ( in_array( 'trash', $q_status ) )
     2128                                        $r_status[] = "$wpdb->posts.post_status = 'trash'";
     2129                        }
    21252130
    21262131                        if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
Note: See TracChangeset for help on using the changeset viewer.