Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from kimcoleman/dev
Browse files Browse the repository at this point in the history
Tested up to version bump
  • Loading branch information
kimcoleman authored Mar 13, 2021
2 parents 469c623 + 586511b commit 409c78e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions hide-admin-bar-from-non-admins.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,24 @@
Description: A tweak of the code by Yoast to hide the admin bar for non-admins only.
Version: 1.0
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
Author URI: https://www.strangerstudios.com
*/
/*
Copyright 2013 Stranger Studios (email : [email protected])
Licensed under the GPLv2 license: http://www.gnu.org/licenses/gpl-2.0.html
*/

function habfna_hide_admin_bar_settings()
{
?>
function habfna_hide_admin_bar_settings() { ?>
<style type="text/css">
.show-admin-bar {
display: none;
}
</style>
<?php
}
function habfna_disable_admin_bar()
{
if(!current_user_can('administrator'))
{

function habfna_disable_admin_bar() {
if ( ! current_user_can( 'administrator' ) ) {
add_filter( 'show_admin_bar', '__return_false' );
add_action( 'admin_print_scripts-profile.php', 'habfna_hide_admin_bar_settings' );
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: strangerstudios
Tags: admin bar, adminbar, dashboard, membership
Requires at least: 3.1
Tested up to: 5.2.2
Tested up to: 5.7
Stable tag: 1.0

The WordPress admin bar will be hidden for all non-admin users.
Expand Down

0 comments on commit 409c78e

Please sign in to comment.