Support

Account

Home Forums Feature Requests Many to Many Relationship between custom post types

Helping

Many to Many Relationship between custom post types

  • Currently, by using the relationship – field, it is only possible to build a relation in a one way direction.

    -> 1:n relationship

    You have a really nice tutorial about doctors and locations at the tutorial secion. You can bind locations to doctors, but you cannot bind doctors to locations.

    Workaround:
    Currently, i have to build a 1:n relationship for doctors relating to locations and 1:n relationship for locations relating to doctors and finally, i have to merge the post ids in code. Really Dirty!

    An absolutely nice solution would be a n:m relationship field, where both post types would have a relationship form depending on each other.

    So when i add a doctor to a location on the “edit locations” – page it will be marked on the “doctors edit” – page at the same time.

    Thank you for reading

  • Hi @sjaeckel

    Thanks for the question, yes, this is a limitation of the relationship field.
    What you want is to use the posts2posts plugin which provides custom fuctionality and a custom db table to do all the joins.

    This will allow you to do many to many connections much better than with ACF.

    http://wordpress.org/plugins/posts-to-posts/

    Thanks
    E

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

The topic ‘Many to Many Relationship between custom post types’ is closed to new replies.