Home Forums Backend Issues (wp-admin) "Add All" Function Reply To: "Add All" Function

  • Hi @lisa-wilson1111

    Your understanding is correct, but you can simplify it like this:

    1. Create a true/false field type that says “Select all members on save?” and place it after the relationship field. You can also hide the relationship field if the true/false field is selected by using the conditional logic.

    2. When a user saves the post, you can use the “acf/save_post” hook to check if the true/false field is selected. If it is, then update the relationship field by using the update_field() function.

    3. The page is reloaded automatically when the user clicks the save button, so the relationship fields should show the correct result after that.

    I hope this makes sense 🙂