Home › Forums › Bug Reports › ACF returning ID instead of an array and count of repeater instead of an array › Reply To: ACF returning ID instead of an array and count of repeater instead of an array
Hi @almazka
I think it’s because your posts_where hook modified ACF’s fields (which is also a post apparently). I believe you need to check if the queried post is not acf-field like this:
add_filter( 'posts_where' , 'my_where', 10, 2 );
function my_where( $where, $query ){
global $wpdb,$wp_query;
if ($query->query_vars['post_type'] != 'acf-field') {
$where .= " AND wp_posts.post_title LIKE 'b%'";
}
return $where;
}
Hope this helps.
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.