Filter to change the Custom Filter Layout
-
Hi,
I want to change the Custom Filter Layout, so :
- I selected “Custom Layout” as “filter type” in the filter layout panel
- In functions.php I wrote the full example wrote here then called :
add_filter('ymc_filter_custom_layout_545_1', 'my_custom_filter_layout', 10, 6);
But nothing happended : on my page I always get the message to write an
add_filter("ymc/filter/layout/top/custom", "callback_function", 10, 5);hook. If I write this hook, for example :add_filter('ymc/filter/layout/top/custom_22941_1', function ($output, $filter_id, $taxonomies, $term_settings, $container_class) {
$terms = '';
foreach ($taxonomies as $taxonomy) {
foreach ($term_settings[$taxonomy]['terms'] as $term_id => $term_info) {
// For example, output all visible terms
if ($term_info['term_visible']) {
$terms .= "<div class=\"{$term_info['term_class']}\">{$term_info['term_name']}</div>";
}
}
}
return $terms;
}, 10, 5);It works perfectly.
Many thanks for your help !
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.