WordPress.org

Ready to get started?Download WordPress

Forums

BlackBox Debug Bar
[resolved] Display debug bar only to admins (4 posts)

  1. xclamation
    Member
    Posted 1 year ago #

    Hi Greg,

    First off, thanks for creating such a great plugin and releasing it for free.

    I use your plugin on my clients websites while the sites are in development to help me debug. However, sometimes I use your plugin on live websites in order to debug issues too.

    Could you possibly look at adding a conditional statement to only display the debug bar if the user is logged in as admin? I really don't see the point of displaying the debug bar to non-logged in users or basic 'subscribers'.

    Thanks,

    Matthew

    http://wordpress.org/extend/plugins/blackbox-debug-bar/

  2. Diego
    Member
    Posted 1 year ago #

    I had the same issue and I modified the plugin myself. The patched version can be found in my forked Git Repository.

  3. Greg Winiarski
    Member
    Plugin Author

    Posted 1 year ago #

    You can add following code in theme functions.php file (or put it in a new plugin)

    add_action("init", "blackbox_disable");
    function blackbox_disable() {
        if(!current_user_can("edit_plugins")) {
            remove_action('admin_footer', array("BlackBox_Hook", "footer"));
            remove_action('wp_footer', array("BlackBox_Hook", "footer"));
        }
    }

    this will disable BlackBox for all users except Administrators.

  4. xclamation
    Member
    Posted 1 year ago #

    Thanks to both daigo75 and Greg! I went with Gregs solution in the end.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic