Support

Account

Home Forums ACF PRO Bidirectional Relationships and multiple post types Reply To: Bidirectional Relationships and multiple post types

  • A bit more info on how to achieve this (using shawnrosspeters example) with Post-2-Post without any code tweaking:

    With ACF Post-2-Post, this can be done simply by:

    Team CPT
    – Create a custom field group for Team CPT
    – Set the field group to be visible only on Team CPT
    – Create there the field “Related Players” and give it the fieldname “players-teams”
    – Filter by Post Type = Player CPT

    Player CPT
    – Create a custom field group for Player CPT
    – Set the field group to be visible only on Player CPT
    – Create field “Related Teams”
    – Reuse the same fieldname as for Team CPT Related Players (“players-teams”)
    – Filter by Post Type = Team CPT

    * With this method, you will have a different field label for each of the 2 different custom post types.
    * The filtering will only to show results of the other CPT when selecting posts for the relationships.
    * By virtue of using the same fieldname “players-teams” in both field group fields, the Post-2-Post plugin works perfectly, ensuring that the bidirectional relationships are established.