From: Laury GvR Date: Fri, 26 Jan 2018 20:51:20 +0000 (-0500) Subject: Filter placing packages in custom locations in custom viewfiles X-Git-Tag: v1.2.18^2~10 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=502a391674d1f3fd629ebacf8079001e48f0e87e;p=WP-Plugins%2Fglm-member-db-packaging.git Filter placing packages in custom locations in custom viewfiles Added a filter to add packages in a custom location on custom member detail viewfiles. Normally packages are placed in the member detail using the descriptionAfter filter. --- diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 184db3e..8f2f796 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -160,6 +160,19 @@ if (isset($this->config['addOns']['glm-member-db'])) { 10, 2 ); + + // Add content to member detail page - Get it from the existing package listing shortcode + // Unlike the filters above this one is not listed by default on the member detail page + // but can be applied to custom member db view files if they remove any "descriptionAfter" + // filter application + add_filter('glm-member-db-front-members-detail-packages', function($content, $id) { + $packageData = do_shortcode('[glm-members-packaging-list member='.$id.', template="member-detail" order="title"]'); + $content .= $packageData; + return $content; + }, + 10, + 2 + ); }