From: Steve Sutton Date: Tue, 19 Apr 2016 16:44:21 +0000 (-0400) Subject: Remove the admin toolbar for none admin users X-Git-Tag: v1.0.0^2~70 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d879867783bf91df46ec0714b61528ef894ac827;p=WP-Themes%2FDiscoverKZOO.git Remove the admin toolbar for none admin users --- 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); + } +} ?>