From: Steve Sutton Date: Wed, 26 Oct 2016 16:00:01 +0000 (-0400) Subject: Update for not using member and the login redirect X-Git-Tag: v2.8.2^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=f06306e1ac718aa8734a045973a9e2b2b55db124;p=WP-Plugins%2Fglm-member-db.git Update for not using member and the login redirect Don't redirect users unless members is used. --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index e413c75b..85565a93 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -120,8 +120,10 @@ function glmRemoveDashboard () { reset($menu); // Also redirect user away from main WordPress dashboard should they get there. - if ( preg_match( '#wp-admin/?(index.php)?$#', $_SERVER['REQUEST_URI'] ) && ( 'index.php' != $menu[$page][2] ) ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/admin.php?page=glm-members-admin-menu-member'); + if ( $this->config['settings']['enable_members'] ) { + if ( preg_match( '#wp-admin/?(index.php)?$#', $_SERVER['REQUEST_URI'] ) && ( 'index.php' != $menu[$page][2] ) ) { + wp_redirect( get_option( 'siteurl' ) . '/wp-admin/admin.php?page=glm-members-admin-menu-member'); + } } }