From: Laury GvR Date: Mon, 2 Jul 2018 20:00:31 +0000 (-0400) Subject: Adjust member category filter to allow parameters X-Git-Tag: v2.10.37^2~30 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=c7a5a673b56d71b7819c875e555dbe5f3dac3489;p=WP-Plugins%2Fglm-member-db.git 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. --- 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 );