Home › Forums › Front-end Issues › Make fields required only on front-end form? › Reply To: Make fields required only on front-end form?
use https://www.advancedcustomfields.com/resources/acf-prepare_field/ see options there
add_filter('acf/prepare_field', 'required_on_front');
required_on_front($field) {
if (!is_admin()) {
$field['required'] = true,
}
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.