Debug Bar
Using Debug Bar with custom User Bar (or none) (1 post)

  1. Eric Andrew Lewis
    Posted 4 years ago #

    This was a bit tricky, but thought I'd show my code if anyone else bumps into this.

    Just add a div element with the ID of "wp-admin-bar-debug-bar" for the "Debug" button wherever you want it, and this code wherever you see fit (functions.php works)

    if ( is_super_admin() ) {
    global $debug_bar;
    add_action('init', array(&$debug_bar, 'init'));
    add_filter('show_admin_bar', 'show_admin_bar_maybe');
    add_action( 'wp_footer', array(&$debug_bar, 'render'));
    function show_admin_bar_maybe($bool) {
    global $bt;
    $bt = debug_backtrace();
    if( $bt[4]['function'] == "init" && $bt[4]['class'] == "Debug_Bar" )
    return true;
    return $bool;


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Debug Bar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by Eric Andrew Lewis
  • This topic is not a support question
  • WordPress version: 3.3.1