Index colors within ACF checkbox fields

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add the following to your (child) theme’s functions.php
add_filter( ‘facetwp_index_row’, function( $params, $class ) {
if ( ‘MYCOLOR’ == $params[‘facet_name’] ) {
$raw_value = $params[‘facet_value’];
$params[‘facet_value’] = str_replace( ‘#’, ”, $raw_value );
$params[‘facet_display_value’] = $raw_value;
}
return $params;
}, 10, 2 );
{{/gist}}