Support

Account

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?