Home › Forums › Front-end Issues › Query posts by user relationship field › Reply To: Query posts by user relationship field
I also have this issue and believe it to be a bug with ACF. I have a created a bidirectional relationship between two post types using two relationship fields. I have been querying these fields using WP_Query as you would normally wrapping the value (in this case a post ID) with double quotes.
However customers have told me that the query is not selecting the correct number of posts. When I looked into this I noticed that sometimes the array values are not being saved with double quotes within the serialised array. See screenshot of phpmyadmin.
Any ideas on what could be causing this would be great, it’s bringing me great stress and frustration at the moment.
Also, @hube2 as a work around I wondered if I could query both '"' . $post_ID . '"'
as you would normally but also ':' . $post_ID . ';'
or am I likely to run into issues with selecting the wrong posts due to the numbers in the serialised array?
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.