Hi @andrewtayloruk82
For that, you can either modify the chips.php template following the templates overriding – https://filtereverything.pro/resources/templates-overriding/
Or use the hook “wpc_chips_term_name”, here is s small example how to work with it:
// Define the callback function for the 'wpc_chips_term_name' filter hook
function modify_chips_term_name($term_name, $term, $filter) {
// Modify the term name as desired
$modified_term_name = 'Modified ' . $term_name;
// Return the modified term name
return $modified_term_name;
}
// Hook the callback function to the 'wpc_chips_term_name' filter hook
add_filter('wpc_chips_term_name', 'modify_chips_term_name', 10, 3);
Best Regards – Victor
Thanks, I tweaked the example slightly to support multiple terms.
// Define the callback function for the 'wpc_chips_term_name' filter hook
function modify_chips_term_name($term_name, $term, $filter) {
// Define an associative array with term IDs as keys and modified names as values
$term_modifications = [
704 => 'Auto: Yes', // Auto: Yes | replacing value of Yes
678 => 'Auto: No', // Auto: No | replacing value of No
];
// Check if the current term's ID exists in the modifications array
if (array_key_exists($term->term_id, $term_modifications)) {
// Return the modified name for the specific term ID
return $term_modifications[$term->term_id];
}
// Return the original term name if the term ID is not in the modifications array
return $term_name;
}
// Hook the callback function to the 'wpc_chips_term_name' filter hook
add_filter('wpc_chips_term_name', 'modify_chips_term_name', 10, 3);