Home › Forums › Feedback › ACF Postbox classes / CSS identifiers › Reply To: ACF Postbox classes / CSS identifiers
Thanks!
Ended up with this:
function change_style_test($content) {
switch ($content['title']) {
case 'Title1':
$content['style'] = 'acf-postbox-title1';
break;
case 'Title2':
$content['style'] = 'acf-postbox-title2';
break;
default:
$content['style'] = 'seamless';
break;
}
/*
// Test to see output
echo '<pre>';
print_r($content);
echo '</pre>';
*/
return $content;
}
add_filter('acf/get_field_group', 'change_style_test');
It can be automized though, sanitize the title and add that as a class.
BTW, i’m not that experienced with using filters in WordPress. Is it possible to get an overview of filters and actions launched in a plugin? Or is it just digging around?
But, it would still be great to have some <wrapper start> and </wrapper end> field in ACF so you have more control of the structure and looks of ACF.
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.