[wp-trac] [WordPress Trac] #18284: Introduce 'post_status' => 'publish_or_private'
WordPress Trac
wp-trac at lists.automattic.com
Thu Jul 28 19:26:20 UTC 2011
#18284: Introduce 'post_status' => 'publish_or_private'
-------------------------+-----------------------------
Reporter: scribu | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Keywords:
-------------------------+-----------------------------
This code:
{{{
$query = new WP_Query();
print_r( $query->posts );
}}}
will contain private posts, if the user has the appropriate capabilities.
This code:
{{{
$posts = get_posts();
print_r( $posts );
}}}
won't contain private posts.
That's because get_posts() always sets 'post_status' to 'publish', for
back-compat.
Therefore, I propose we introduce an explicit 'publish_or_private' value,
which would allow this:
{{{
$posts = get_posts( array( 'post_status' => 'publish_or_private' ) );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18284>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list