From: Laury GvR Date: Fri, 26 Jan 2018 20:53:24 +0000 (-0500) Subject: Filter to add event in custom spots in custom viewfiles X-Git-Tag: v1.6.77^2~20 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=75477a53eb5383d7319e3791ca4b07b78e73f544;p=WP-Plugins%2Fglm-member-db-events.git 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. --- 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 + ); }