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
Now I see, WP is setting the font weight for b,strong to 600. ACF is also setting the font weight of tab text to 600, so there’s no difference. You will need to set the font weight. You can do this in one of two ways. You can add a custom style sheet for the admin or you can do it inline. I would do it inline.
// 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 style="font-weight: bold;">'.$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.