Home › Forums › Backend Issues (wp-admin) › "Add All" Function › Reply To: "Add All" Function
Hello there,
I agree that the first option is not really achievable, but I’d like to elaborate on the second one, if that’s all right.
1) We add the button in HTML
2) On clicking this button, we bind a JavaScript function toggling a variable say “SelectAll” to true or false.
3) We’d somehow indicate to the user that All or None are selected.
4) When user saves the post we use the acf/save_post hook to read our “SelectAll” variable and depending on its value we update the field accordingly. (Add or remove all guest members).
5) Page reloads and correct result appears in the relation field.
Can you please confirm my understanding is correct?
Thank you 🙂
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.