WP_Query: retrieve posts of publish and private of the logged-in user
-
Hi there,
I’m wondering if there is a way to perform a single WP_Query query with the following conditions:
– retrieve posts of the custom post type
test
– AND with the post status ofpublish
posted by all users
– AND the post status ofprivate
of the logged-in user (meaning not retrieving somebody else’s private posts)I first thought this can be achieved with two separated queries but when merging the results, the sort order will be messed. Also to keep the number of database queries at minimum is preferable.
If you know a good way of doing this, it would be appreciated. Thank you!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘WP_Query: retrieve posts of publish and private of the logged-in user’ is closed to new replies.