Home › Forums › General Issues › Image field returns ID, not Array, when filtering › Reply To: Image field returns ID, not Array, when filtering
Well, the pre_get_posts filter you have is probably interfering with other queries. What you need to do is to limit it more.
Instead of just checking to see if it’s the admin do something like
if (is_admin() || !$query->is_main_query()) {
// limit to only the main query
return;
}
You may also need to do further limiting, for example limiting it to a specific post type
if (!isset($query->query_vars['post_type']) ||
$query->query_vars['post_type'] != 'post') {
return;
}
the code examples given here are meant for reference and simple examples and may not be everything you need.
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.