From: Steve Sutton Date: Fri, 9 Dec 2016 21:08:31 +0000 (-0500) Subject: Update for frontHooks. When to call in coupons. X-Git-Tag: v1.0.0^2~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=ee65a370a3aeb45a45a9d86907f134874df0e0b3;p=WP-Plugins%2Fglm-member-db-coupons.git 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. --- 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,