<?php
/**
* Disable Admin Bar for Non-Admin Users
*
* This function hides the WordPress admin bar on the front end
* for all users except administrators.
*/
function wpsnippetpress_disable_admin_bar() {
if ( ! current_user_can( 'administrator' ) ) {
show_admin_bar( false );
}
}
add_action( 'after_setup_theme', 'wpsnippetpress_disable_admin_bar' );PHP