Support

Account

Home Forums Front-end Issues WP_Query with user array field Reply To: WP_Query with user array field

  • Hi @Exelmans Graphics
    Thanks for the info.

    because your field is a multi-select, the data will be saved into the DB as a serialized array of user ID’s.

    The WP_Query does not contain any feature to search for serialized data, this is why we need to use a LIKE hack.

    This is all documented on the reverse relationship documentation here:
    http://www.advancedcustomfields.com/resources/field-types/relationship/

    Note: The relationship field saves it’s data as a serialized array of post_ids. It is exactly the same as what you have, so the technique will work the same too

    Thanks
    E