current_user = wp_get_current_user(); $this->admin_email = get_bloginfo('admin_email'); } function is_user_contributor() { $result = array_intersect( [self::$allowed_role], $this->current_user->roles ); if(empty($result)) { return false; } else { return true; } } }