Why does get_posts only show results for Admins or logged-out users?
I use a get_posts()
call with these arguments:
array(6) {
["include"]= string(14) "1633,1634,1635"
["post_status"]= string(3) "any"
["post_type"]= string(10) "attachment"
["post_mime_type"]= string(5) "image"
["order"]= string(3) "ASC"
["orderby"]= string(8) "post__in"
}
While logged out or logged in as an Admin, it works fine and returns the objects for 3 images. However, when the user is just a Subscriber/Author/Editor/Contributor, it returns an empty array.
All plugins enabled/disabled doesn't make a difference.
When switching the theme to an official WP theme, the error no longer persists.
I've dumped all hooks using this (one logged in with subscriber, one with admin), but I find no considerable difference. Case A / Case B. I was assuming that the theme alters my arguments to an extent that there are no results for the altered query. If it's still the case, how and where should it do that?
The theme is Javo Directory.
Topic user-access user-roles get-posts wp-query themes Wordpress
Category Web