From ee65a370a3aeb45a45a9d86907f134874df0e0b3 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 9 Dec 2016 16:08:31 -0500 Subject: [PATCH] Update for frontHooks. When to call in coupons. For the detail page only get coupons if the option to display on detail page is set. --- setup/frontHooks.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup/frontHooks.php b/setup/frontHooks.php index b3784a4..60e8099 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -26,9 +26,13 @@ * *** Also note that parameters will be in the context of the main front controller constructor. *** */ // Add content to member detail page - Get it from the existing coupon shortcode -add_filter('glm-member-db-front-members-detail-descriptionAfter', function($content, $id) { - $eventData = do_shortcode('[glm-members-coupons-list member='.$id.' template="member-detail"]'); - $content .= $eventData; +add_filter('glm-member-db-front-members-detail-descriptionAfter', + function($content, $id) { + global $config; + if ( $config['settings']['detail_show_coupons'] ) { + $eventData = do_shortcode('[glm-members-coupons-list member='.$id.' template="member-detail"]'); + $content .= $eventData; + } return $content; }, 10, -- 2.17.1