From 75477a53eb5383d7319e3791ca4b07b78e73f544 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 26 Jan 2018 15:53:24 -0500 Subject: [PATCH] Filter to add event in custom spots in custom viewfiles Added a filter to add events in a custom location on custom member detail viewfiles. Normally events are added using the descriptionAfter filter. Any viewfile can use this filter to display the events separately as long as the descriptionAfter filter in said viewfile is removed. --- setup/frontHooks.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 4e55154..6e823fc 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -203,6 +203,19 @@ if (isset($this->config['addOns']['glm-member-db'])) { 10, 2 ); + + // Add content to member detail page - Get it from the existing event 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-events', function($content, $id) { + $eventData = do_shortcode('[glm-members-event-list member='.$id.', template="member-detail" order="title"]'); + $content .= $eventData; + return $content; + }, + 10, + 2 + ); } -- 2.17.1