From: Steve Sutton Date: Thu, 11 Jul 2019 15:00:35 +0000 (-0400) Subject: Hide dashboard widget if coupons for members turned off. X-Git-Tag: v1.0.2^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=255f138d461768cd98ce92142175eec39cec012e;p=WP-Plugins%2Fglm-member-db-coupons.git Hide dashboard widget if coupons for members turned off. --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 096b6d2..75e3e1b 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -25,15 +25,17 @@ * * Also note that parameters will be in the context of the main admin controller constructor. */ -add_filter( - 'glm-member-db-dashboard-member-widgets', - function ( $member = null ) { - $content = $this->controller( 'dashboard', 'coupons', $member ); - return $content; - }, - 14, - 1 -); +if ( $this->config['settings']['allow_member_coupons'] ) { + add_filter( + 'glm-member-db-dashboard-member-widgets', + function ( $member = null ) { + $content = $this->controller( 'dashboard', 'coupons', $member ); + return $content; + }, + 14, + 1 + ); +} add_filter( 'glm-member-db-dashboard-member-admin-widgets', function ( $member = null ) {