Updating the adminHooks to check if enable_members is on before redirecting.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 26 Oct 2016 16:09:04 +0000 (12:09 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 26 Oct 2016 16:09:04 +0000 (12:09 -0400)
Redirection without enable members is causing an error.

setup/adminHooks.php

index f642f09..36b06a0 100644 (file)
@@ -103,10 +103,10 @@ add_action( 'add_meta_boxes', function() {
 
 // If not administrator, don't show or permit access to the main dashboard
 function glmRemoveDashboard () {
-    global $current_user, $menu, $submenu;
+    global $current_user, $menu, $submenu, $config;
 
     // If user isn't an administrator
-    if (!in_array('administrator', $current_user->roles) && $this->config['settings']['enable_members']) {
+    if (!in_array('administrator', $current_user->roles) && $config['settings']['enable_members']) {
 
         // Get rid of the main WordPress admin "Dashboard"
         reset( $menu );