Last active
June 22, 2024 22:18
-
-
Save nextab/4e0bb6ec83a33dc8ddece7aa1512bbee to your computer and use it in GitHub Desktop.
Clean Up WP Admin Bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #region Clean Up WP Admin Bar | |
| function remove_admin_bar_links() { | |
| global $wp_admin_bar; | |
| $wp_admin_bar->remove_menu('wp-logo'); // Remove the Wordpress logo + sub links | |
| // $wp_admin_bar->remove_menu('site-name'); // Remove the site name menu | |
| // $wp_admin_bar->remove_menu('view-site'); // Remove the view site link | |
| // $wp_admin_bar->remove_menu('updates'); // Remove the updates link | |
| // $wp_admin_bar->remove_menu('comments'); // Remove the comments link | |
| // $wp_admin_bar->remove_menu('new-content'); // Remove the content link | |
| // $wp_admin_bar->remove_menu('my-account'); // Remove the user details tab | |
| } | |
| add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' ); | |
| #endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment