Private posts don’t appear when post_type is array in WP_query
-
Hi,
I’m not sure if there’s something in my theme’s functions.php file causing this problem, but from all the testing I’ve done, I don’t think so. Hopefully somebody else can reproduce this issue:
When I use WP_Query to query posts while logged in as administrator, any posts set to ‘private’ only appear if ‘post_type’ is EITHER:
1. left out of the args completely
2. set to a single string like ‘post’
3. set to an array with a single item like array(‘post’)If it’s set to an array of multiple types e.g.: array(‘post’, ‘page’) then ‘private’ posts disappear completely from the site. I can only get them back by manually setting ‘post_status’ in the args as well, e.g. to: array(‘publish’, ‘private’)
I’ve scoured docs and references and forums for hours, and can’t find this issue anywhere. Can anybody help?
Cheers
- The topic ‘Private posts don’t appear when post_type is array in WP_query’ is closed to new replies.