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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.