Support

Account

Home Forums ACF PRO extend relationship field query filter

Helping

extend relationship field query filter

  • Hi,
    I need to extend acf/fields/relationship/query/name={$field_name} – filter
    for match search string also inside related post custom relatioship field.

    I’ll try to give sense to that sentence:
    My news post has a relationship field which points to events custom post type.
    Again my event custom post has a relationship field which points to submitters custom post type.

    When I’m editing my news post and I want to quickly find events to relate with it, I need to extend the query filter for “events” to search also in
    related submitters title.

    I hope someone understand what I mean.
    Thanks in advance

  • This isn’t going to be possible using the standard ACF relationship field.

    Even if there was a filter hook available to return the posts you’d need to search the post type that is related to the post type and then do a reverse relationship query to return the posts in the first post type. My head hurts thinking about it πŸ™‚

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.