From: Anthony Talarico Date: Thu, 13 Apr 2017 15:46:02 +0000 (-0400) Subject: added category id filter to functions.php, set up list view apply the filter X-Git-Tag: v1.0.0^2~47 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a0a0d1ef6f0ea224e64291485143e1ddae569359;p=WP-Themes%2Fbrewbakers.git added category id filter to functions.php, set up list view apply the filter to check for the ids in the category array placed filter in functions.php that will allow the list view template in the theme to have access to the set of manufacturer ids and compare them to the categories in the category array supplied by the list model. this is to build out of the list of manufacturers and brands for the search widget --- diff --git a/functions.php b/functions.php index a525adf..c32d70f 100644 --- a/functions.php +++ b/functions.php @@ -19,7 +19,10 @@ if (!function_exists('glm_quicksite_widget_init')) { } } - +add_filter('manufacturer_ids', function(){ + $ids = [3,11]; + return $ids; +}); /** * Return the client info option for the given key * diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index d10c636..5d2d69e 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -2,6 +2,7 @@ {if $settings.list_map_show_opened}map-opened{else}map-closed{/if} {if $settings.list_show_search_filters_opened}filters-opened{else}filters-closed{/if} "> + {include file='front/members/header.html'} {apply_filters('glm-member-db-front-members-list-pageTop', '')}
@@ -32,11 +33,17 @@ {/if}
+ {$manufacturer_ids=apply_filters('manufacturer_ids', '')} {if $settings.list_show_search_category} {$rvTypes = array()} {$rvManufacturers = array()} {$brands = array()} {foreach from=$categories item=v} + {if $v.id|in_array:$manufacturer_ids} + + {else} + + {/if} {if $v.parent == 'RV Classes'} {$rvTypes[$v.id] = $v} {elseif $v.parent == 'RV Manufacturers'} @@ -46,6 +53,10 @@ {/if} {/foreach}
+ + {foreach $manufacturer_ids as $manufacturer_id} + + {/foreach}