Home › Forums › Bug Reports › Gallery Field returns empty Array › Reply To: Gallery Field returns empty Array
Your filter is basically altering every front end query for all logged in users that can upload files. You need to be more specific about what queries to alter.
This will get you started
add_action('pre_get_posts','allow_pending_posts_wpse_103938');
function allow_pending_posts_wpse_103938($qry) {
if (!is_admin() && current_user_can('upload_files') &&
$qry->is_main_query()) {
$qry->set('post_status', array('publish','pending','draft'));
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.