Home › Forums › Front-end Issues › Disable certain taxonomy terms › Reply To: Disable certain taxonomy terms
The only way that I can think to do this would be to create an acf/update_value filter https://www.advancedcustomfields.com/resources/acf-update_value/ for this field and then add any required term IDs to the value
add_filter('acf/update_value/name=your-field_name', 'force_required_terms', 20, 3);
function force_required_terms($value, $post_id, $field) {
// required term ID 1234
if (!in_array(1234, $value)) {
$value[] = 1234;
}
return $value;
}
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.