{"id":19004313,"date":"2026-08-27T09:02:05","date_gmt":"2026-08-27T09:02:05","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/filter-to-change-the-custom-filter-layout\/"},"modified":"2026-08-27T09:02:05","modified_gmt":"2026-08-27T09:02:05","slug":"filter-to-change-the-custom-filter-layout","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/filter-to-change-the-custom-filter-layout\/","title":{"rendered":"Filter to change the Custom Filter Layout"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I want to change the Custom Filter Layout, so : <\/p>\n\n\n\n<ul>\n<li>I selected &#8220;Custom Layout&#8221; as &#8220;filter type&#8221; in the filter layout panel <\/li>\n\n\n\n<li>In functions.php I wrote the full example wrote <a href=\"https:\/\/github.com\/YMC-22\/smart-filter\">here<\/a> then called : <code>add_filter('ymc_filter_custom_layout_545_1', 'my_custom_filter_layout', 10, 6);<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">But nothing happended : on my page I always get the message to write an <code>add_filter(\"ymc\/filter\/layout\/top\/custom\", \"callback_function\", 10, 5);<\/code> hook. If I write this hook, for example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('ymc\/filter\/layout\/top\/custom_22941_1', function ($output, $filter_id, $taxonomies, $term_settings, $container_class) {<br \/><br \/>$terms = '';<br \/><br \/>foreach ($taxonomies as $taxonomy) {<br \/><br \/>foreach ($term_settings&#091;$taxonomy]&#091;'terms'] as $term_id =&gt; $term_info) {<br \/><br \/>\/\/ For example, output all visible terms<br \/><br \/>if ($term_info&#091;'term_visible']) {<br \/><br \/>$terms .= \"&lt;div class=\\\"{$term_info&#091;'term_class']}\\\"&gt;{$term_info&#091;'term_name']}&lt;\/div&gt;\";<br \/><br \/>}<br \/><br \/>}<br \/><br \/>}<br \/><br \/>return $terms;<br \/><br \/>}, 10, 5);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It works perfectly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Many thanks for your help !<\/p>\n","protected":false},"template":"","class_list":["post-19004313","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19004313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19004313\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19004313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}