WordPress.org

Ready to get started?Download WordPress

Forums

Improved Simpler CSS
[resolved] Subscriber role can see "Custom CSS" in admin toolbar (2 posts)

  1. jeffvand
    Member
    Posted 1 year ago #

    I love the custom css plugin! Thanks for putting this together. I have one issue. The subscriber role can see "Custom CSS" in the admin toolbar when logged in. They can not access it, but it shows up in their toolbar which is confusing for some of our subscribers. Any way we can remove that?

    Thanks so much!

    http://wordpress.org/extend/plugins/imporved-simpler-css/

  2. jeffvand
    Member
    Posted 1 year ago #

    I finally took some time today to figure this one out. I added the following to my theme functions.php file to remove the "Custom CSS" for everyone but the administrators.

    if (!current_user_can('manage_options')) {
    function remove_customcss_bar_links() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('custom-css');
    }
    add_action( 'wp_before_admin_bar_render', 'remove_customcss_bar_links' );
    }

    I would suggest the author update his function around ln 77 to reflect this too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic