Support

Account

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.