Home › Forums › Add-ons › Repeater Field › pre_get_post and nested while loop › Reply To: pre_get_post and nested while loop
The reason is that pre_get_posts is applied to all post queries and ACF does a query to get the posts in the relationship field. When you use pre_get_posts you need to check the details of the query being done before you alter the query. In this case just making sure that you only make changes to the main query. Your filter could have other side effects, like being run on the wrong post type or even being run int the admin causing the admin post list to be altered.
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.