March 2020
Beginner
660 pages
18h 28m
English
The admin toolbar is enabled by default for logged-in users. It will be visible in both the frontend and backend of the site. However, this can be a distraction for non-admin users viewing the frontend of the site, so most sites remove this toolbar for non-admin users. The visibility of the admin toolbar can be changed by using the show_admin_bar core function. The following code can be used directly inside the functions.php file of the theme, to disable the toolbar for all users:
show_admin_bar(false);
However, we need to enable/disable the toolbar from our plugin. So, we used after_setup_theme to execute a callback function. This is a core WordPress action that's executed after the theme is completely loaded and set up. ...
Read now
Unlock full access