Home › Forums › Backend Issues (wp-admin) › "Add All" Function › Reply To: "Add All" Function
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 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.