Home › Forums › General Issues › Hide a tab in flexible content by option on option field › Reply To: Hide a tab in flexible content by option on option field
Not only would you need to hide the tab but you would also need to filter and hide all of the fields in that tab.
You do not want to unset the field, you need to return false
// Apply to fields named "example_field".
add_filter('acf/prepare_field/key=field_60647c32d82ce', 'hide_ani_tab');
function hide_ani_tab($field) {
if ( false == get_field( 'animation_option', 'option' ) ) {
// remove tab by field key
return false;
}
return $field;
}
but as I said, this would need to be done for the tab and all of the fields in the tab
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.