Home › Forums › Feature Requests › Exclude checkbox for frontend form › Reply To: Exclude checkbox for frontend form
I’d love to see an “admin/backend only” flag for fields.
Right now I’m testing things with a simple approach:
function prefix_hide_field($field) { return false; }
add_filter(‘acf/load_field/name=/*somefield_1*/’, ‘prefix_hide_field’);
add_filter(‘acf/load_field/name=/*somefield_2*/’, ‘prefix_hide_field’);
/* … */
add_filter(‘acf/load_field/name=/*somefield_n*/’, ‘prefix_hide_field’);
But I fear the amount of add_filter()’s is going to eventually be a pain to maintain. Flagging fields would be a great help in terms of back-end UX design because in complex scenarios you will want to have logical groups of fields that pertain to a certain set of data and functions yet only allow access to a select set of those fields to members (from the front-end).
Of course, it is possible to split options into different field groups and only include front-end-user field groups through the acf_form() options parameter but it makes it much harder and less intuitive from the standpoint of logically ordering things by areas of function.
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.