From d879867783bf91df46ec0714b61528ef894ac827 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 19 Apr 2016 12:44:21 -0400 Subject: [PATCH] Remove the admin toolbar for none admin users --- functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions.php b/functions.php index 748adf3..0107410 100644 --- a/functions.php +++ b/functions.php @@ -193,4 +193,11 @@ function landing_page_blocks( $atts ) return $out; } add_shortcode('glm-blocks', 'landing_page_blocks'); +add_action('after_setup_theme', 'remove_admin_bar'); + +function remove_admin_bar() { + if (!current_user_can('administrator') && !is_admin()) { + show_admin_bar(false); + } +} ?> -- 2.17.1