Home › Forums › General Issues › Radio Button image label again › Reply To: Radio Button image label again
Here is a snippet of my code:
add_filter( 'acf/load_field/name=alert_icon_dk', 'alert_banner_icons' );
function alert_banner_icons( $field ) {
$field['choices'] = array(
'alert_icon_exclamation' => '<span class="alert-banner-svg-icon" style="width: 20px;height: auto;vertical-align: middle;display:inline-block;"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1s-20.4 20.1-34.7 20.1h-432c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368c7.2-12.3 20.3-19.8 34.5-19.8zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24v-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z" /></svg></span>',
);
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.