Home › Forums › Feature Requests › Filter for flexible content layouts › Reply To: Filter for flexible content layouts
hello,
see this i got this from github
Filter: fcb_bg_colors
Change or add to the available “theme” background colors for blocks
add_filter( ‘fcb_bg_colors’, ‘custom_bg_colors’);
function custom_bg_colors($array) {
$array[‘secondary’] = ‘Secondary’;
return $array;
}
Filter: fcb_btn_colors
Change or add to the available button colors for block calls to action
add_filter( ‘fcb_btn_colors’, ‘custom_btn_colors’);
function custom_btn_colors($array) {
$array[‘secondary’] = ‘Secondary’;
return $array;
}
Filter: fcb_set_block_htag
Set the tag that block titles are wrapped in. This defaults to <h2>. First remove the existing filter and then add your own:
/**
* Make the first block title an h1 and subsequent blocks default to h2
*/
remove_filter( ‘fcb_set_block_htag’, ‘block_htag_level’, 10 );
add_filter( ‘fcb_set_block_htag’, ‘custom_htag_level’, 10, 2 );
function custom_htag_level($title, $htag) {
if($GLOBALS[‘fcb_rows_count’] == 0) {
$htag = ‘h1’;
} else {
$htag = ‘h2’;
}
return ‘<‘ . $htag . ‘>’ . $title . ‘</’ . $htag . ‘>’;
}
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.