The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Debug Bar
Small change request for output HTML in the UI (1 post)

  1. Pete Nelson
    Posted 4 years ago #

    I'm working on a plugin that adds allows developers to add their own custom tabs to the Debug Bar. Because the HTML generated by the UI for each tab uses the class name as the part of ID, if I add my class to the $panels array more than once, the debug bar's jquery code can't tell which unique menu target to display. For example, with two instances of my class, it's generating something like this:

    <a id="debug-menu-link-GunGeekATX_DebugBarExtender" href="#debug-menu-target-GunGeekATX_DebugBarExtender" />
    <a id="debug-menu-link-GunGeekATX_DebugBarExtender" href="#debug-menu-target-GunGeekATX_DebugBarExtender" />

    If the Debug Bar plugin can be modified to make the IDs unique, the the jquery code will display the correct tabs. Modifying the debug-bar.php file, render() method's two foreach loops by adding the $class_loop should do it. Snippet:

    $class_loop = 0;
    $current = ' current';
    foreach ( $this->panels as $panel ) :
    	$class = get_class( $panel ) . $class_loop;
    // etc, reset $class_loop to 0 when done

    It will then output, for example:

    <a id="debug-menu-link-GunGeekATX_DebugBarExtender7" href="#debug-menu-target-GunGeekATX_DebugBarExtender7" />
    <a id="debug-menu-link-GunGeekATX_DebugBarExtender8" href="#debug-menu-target-GunGeekATX_DebugBarExtender8" />


Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic


No tags yet.