Hello,
Thanks for the feedback. You’ll have to customize your own checkbox/radio field. You can use filters like acf/prepare_field
in order to customize the radio label render.
For example:
add_filter('acf/prepare_field/name=my_radio', 'my_acf_radio_image');
function my_acf_radio_image($field){
if(!empty($field['choices'])){
foreach($field['choices'] as $index => &$label){
$label = '<img src="' . get_stylesheet_directory_uri() . '/images/' . $label . '" />';
}
}
return $field;
}
This will get the choices label, and use them to display an image. Here is a screenshot of the field configuration: https://i.imgur.com/JxmzroZ.png
Then add some extra CSS, to hide the actual radio input, and set some border color on image selection:
add_action('acf/input/admin_footer', 'my_acf_radio_image_css');
function my_acf_radio_image_css(){
?>
<style>
.acf-field[data-name=my_radio] > .acf-input > ul > li > label > input{
display:none;
}
.acf-field[data-name=my_radio] > .acf-input > ul > li > label > img{
border:5px solid #E1E1E1;
}
.acf-field[data-name=my_radio] > .acf-input > ul > li > label.selected > img{
border:5px solid #007cba;
}
</style>
<?php
}
Final result: https://i.imgur.com/GAsa8xo.mp4
Hope it helps!
Regards.