my code stock.com

Tobias Hopp

Clean Admin Backend for non-Admins
by Tobias Hopp

Clean Admin Backend for non-Admins

Snippet options

Download: Download snippet as clean-admin-backend-for-non-admins.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

/* Clean the Menu for non-admins 
if(!current_user_can('manage_options')) {
     function rg_cleanBackendForUsers() {
        remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
        remove_menu_page('options-general.php'); // Disallow editing of General Options
        remove_menu_page('tools.php'); // Remove WordPress Tools
        remove_menu_page('themes.php'); // Disallow Theme Selection
        remove_menu_page('shortcodes-ultimate'); // Ultimate Shortcodes
        remove_menu_page('wpcf7'); // WordPress Contact Form 7
        remove_menu_page('easy-modal'); // Easy Modal
        remove_menu_page('tablepress'); // Tablepress
        remove_menu_page('edit.php?post_type=sidebar'); // 
        remove_menu_page('edit.php?post_type=wpdmpro'); // WordPress Download Manager
        remove_menu_page('edit.php?post_type=te_announcements'); // Timeline Express by Evan Hermann
        remove_menu_page('edit-comments.php'); // Edit Comments
        remove_menu_page('menu-posts-cptbc'); // Boostrap Carousel
        remove_menu_page('edit.php?post_type=ditty_news_ticker'); // Ditty News Ticker
        remove_menu_page('menu-posts-te_announcements'); // Timeline Express by Evan Hermann
        remove_menu_page('edit.php?post_type=cptbc'); // Bootstrap Karrusell
        
        wp_add_inline_style('wp-admin', 'li#wp-admin-bar-node_ids { display: none; }');
        wp_add_inline_style('wp-admin', 'li#wp-admin-bar-new-content { display: none; }');
        wp_add_inline_style('wp-admin', 'li#wp-admin-bar-tribe-events { display: none; }');
        wp_add_inline_style('wp-admin', 'li#wp-admin-bar-comments { display: none; }');
        wp_add_inline_style('wp-admin', 'li#gtb-geo-parent { display: none; }');
        wp_add_inline_style('wp-admin', 'li#gtb-webmasters-parent { display: none; }');
    }
}
add_action('admin_menu','rg_cleanBackendForUsers', 100); */

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.