From c7a5a673b56d71b7819c875e555dbe5f3dac3489 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Mon, 2 Jul 2018 16:00:31 -0400 Subject: [PATCH] Adjust member category filter to allow parameters The member_category filter calls a function which has 3 possible parameters, one of which allows any unassigned categories not to show in the list. The filter itself did not allow these parameters, causing empty categories to display whenever the filter is invoked. The defaults for this filter are set to the same defaults that the function has, meaning it should not impact sites already using it. --- setup/frontHooks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/frontHooks.php b/setup/frontHooks.php index edda4b75..3cf1deb8 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -382,11 +382,11 @@ add_filter('member_images', function($memberID, $featured = false, $size = 'larg return $featuredImage; }, 10, 3); -add_filter('member_categories', function(){ +add_filter('member_categories', function($forEdit = true, $forActiveMembers = false, $regionList = false){ include_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataCategories.php'; $categories = new GlmDataCategories( $this->wpdb, $this->config ); - return $categories->getListSortedParentChild(); -}); + return $categories->getListSortedParentChild($forEdit, $forActiveMembers, $regionList); +}, 10, 3); add_filter('member_names_and_ids', function(){ include_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataMembers.php'; $members = new GlmDataMembers( $this->wpdb, $this->config ); -- 2.17.1