Support

Account

Home Forums ACF PRO Cross Reference Relations Reply To: Cross Reference Relations

  • Hi Proacfelie,

    It’s totally possible, the right way (and the easier way) to do it depends on what you exacly need : Display relationship on frontend / backend ? Do you used simple relations field or in repeater ?.

    If your in the worst case, Designer and Project posts have both several relationship in repeater and you want to edit and display in backend and frontend (hope it’s will be understandable) :

    Use the WP save_post action. If you save a Project ( Do with If and get_post_type()) loop on your “Designer” repeater field, and for each “Designer” input you found get and loop on the “Project” repeater field of your Designer post. If the project is already in do nothing, otherwise use acf function to update the field and add a new “Project” row. Do the same when want to save the Designer name in the Project post when saving a Designer post.

    There are proper ways to do it if you don’t need the two repeater and/or if you want to query post based on repeater field key.

    If you need other solution or code example tell it.