- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › ACF-taxonomy field showing term ids not term names
Tagged: ACF-taxonomy field
I solved the problem using the ‘sf_input_object_pre’ filter:
add_filter('sf_input_object_pre', 'pas_filterlabels_aan', 10, 2);
function pas_filterlabels_aan($input_object, $sfid) {
if($input_object['name'] == '_sfm_vakdomein') {
foreach($input_object['options'] as $option) {
$term_id = $option->value;
if ($option->value) {
$term = get_term_by('id', $term_id, 'cursussoort');
$term_label = $term->name;
$option->label = $term_label.' ('.$option->count.')';
}
}
}
return $input_object;
}
Replace ‘_sfm_vakdomein’ by your input object name (is shown in the query string) and ‘cursussoort’ by your taxonomy slug.