Home › Forums › Backend Issues (wp-admin) › Conditionally format a tab name if internal field has value › Reply To: Conditionally format a tab name if internal field has value
https://www.advancedcustomfields.com/resources/acf-prepare_field/
// add filter using field key, change to your tab field's key
add_filter('acf/prepare_field/key=field_123456', 'custom_tab_format', 20);
function custom_tab_format($field) {
// see if other field has value
if (get_field('other_field_name')) {
$field['label'] = '<strong>'.$field['label'].'</strong>';
}
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.