From: Steve Sutton Date: Wed, 26 Oct 2016 16:03:51 +0000 (-0400) Subject: Try again on redirect X-Git-Tag: v2.8.2^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e2a7ac7af09159b3e8864519b590102f7303864d;p=WP-Plugins%2Fglm-member-db.git Try again on redirect Don't redirect if not using members. --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 85565a93..f642f091 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -106,7 +106,7 @@ function glmRemoveDashboard () { global $current_user, $menu, $submenu; // If user isn't an administrator - if (!in_array('administrator', $current_user->roles)) { + if (!in_array('administrator', $current_user->roles) && $this->config['settings']['enable_members']) { // Get rid of the main WordPress admin "Dashboard" reset( $menu ); @@ -120,10 +120,8 @@ function glmRemoveDashboard () { reset($menu); // Also redirect user away from main WordPress dashboard should they get there. - 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'); - } + 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'); } }