Home Forums ACF PRO Dynamically generate relationship multisite Reply To: Dynamically generate relationship multisite

  • You are going to need multiple filters because the query that ACF runs is still being run on the current site.

    Please note that most of this is just a guess…. actually, I tried looking for this quickly and could not find a solution, but here are the steps that would need to be taken.

    1. Your current filter needs to add a pre_get_posts action
    2. In the pre_get_posts action you switch blogs if you need to and alter the query arguments
    3. The pre_get_post action needs to remove itself using remove_filter()
    4. The pre_get_posts action also needs to add an action that will happen after the query is run…. I could not find the proper hook to use here.
    5. In the action that runs after the query gets the posts you need to switch back to the current blog if needed
    6. The final action also needs to remove itself using remove_filter()