Is it possible to hide the admin menu?

[ad_1]

Plugin Author
wptali

(@wptalii)

Hi @devwizard

Yes, we have a custom hook for that: abcon/settings/show_admin

to hide the admin menu entirely, you can use the following code snippet in your functions.php file of your theme or in your custom plugin:

function custom_abcon_hide_menu($show_menu) {
return false; // This will hide the menu
}
add_filter('abcon/settings/show_admin', 'custom_abcon_hide_menu');

if you want to hide the menu for non-administrator you can use:

function custom_abcon_show_menu_for_admins($show_menu) {
if (!current_user_can('administrator')) {
return false; // Hide the menu for non-administrators
}
return $show_menu; // Show the menu for administrators
}
add_filter('abcon/settings/show_admin', 'custom_abcon_show_menu_for_admins');

check our documentation for more details

Hope this helps 🙂

Thanks for the quick reply, was really helpful

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer