Tagged Questions
-1
votes
1answer
39 views
why do drafts return as part of wp_query?
I have some code as plugin, which I call via AJAX from a page one the site. It gets two drop-down values and uses them in tax_query to fetch some posts. Question: why do drafts return amongst results ...
1
vote
0answers
170 views
Does the WP_Query 'private' argument for post status only apply to privately published content?
The only peice of code that I can find that applies to this is on line 2430 in query.php in WP 3.4.1
foreach ( get_post_stati() as $status ) {
if ( in_array( $status, $q_status ) ) {
if ( ...
2
votes
1answer
91 views
Get images only if parent status is publish
I have a site which uses a custom template page for each image, and users can favorite an image. I am then pulling a page of most favorited images:
$args = array(
'post_type' => 'attachment',
...
0
votes
2answers
734 views
Can't get drafts with WP_Query using post_status parameter
I can't seem to get drafts to show up with WP_Query, even when post_status is set to 'any' or 'draft'
$args = array(
'p' => 1234,
'post_type' => ...
0
votes
1answer
387 views
How to Get All Posts but the Private ones?
I am creating a frontend mosaic view where i need to show the most recent posts. So i need to show all published posts to every visitor, but keep the private ones for the logged in users.
I know how ...
8
votes
3answers
7k views
How to Get All Posts with any post status?
i am creating a frontend dashboard where i need to show all the post by the current user. So i need to show posts with all post status. Mainly published, trashed and the pending. I am now using ...