Home › Forums › Front-end Issues › Make fields required only on front-end form? › Reply To: Make fields required only on front-end form?
Thanks for the snippet.
I made two changes. One was to add the ‘function’, and the second was to change it so that no Admin fields are required vs making all Front End fields required.
add_filter('acf/prepare_field', 'not_required_in_admin');
function not_required_in_admin($field) {
if (is_admin()) {
$field['required'] = false;
}
return $field;
}
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.