Filter placing packages in custom locations in custom viewfiles
authorLaury GvR <laury@gaslightmedia.com>
Fri, 26 Jan 2018 20:51:20 +0000 (15:51 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 26 Jan 2018 20:51:20 +0000 (15:51 -0500)
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.

setup/frontHooks.php

index 184db3e..8f2f796 100644 (file)
@@ -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
+    );
 
 }