Plugin Directory

Changeset 687254

Timestamp:
03/25/2013 11:22:52 PM (11 years ago)
Author:
MZAWeb
Message:
  • Show full path to template instead of just name,so it's easier to spot overrides.
  • Introduce filter 'bbp-debug-bar-vars' to add vars at the top (like Forum or Topic ID)
  • Hide the panels if there's nothing to show, like outside bbp pages. (Thanks JJJ)
Location:
debug-bar-bbpress/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • debug-bar-bbpress/trunk/class-debug-bar-bbpress.php

    r687099 r687254  
    1616
    1717    public function prerender() {
    18         $this->set_visible( true );
     18        $vars = array_filter( $this->get_vars() );
     19
     20        if ( empty( $vars ) && empty( $this->templates ) )
     21            $this->set_visible( false );
     22        else
     23            $this->set_visible( true );
    1924    }
    2025
    2126    public function render() {
    2227
    23         $forum = bbp_get_forum_id();
    24         $topic = bbp_get_topic_id();
    25         $reply = bbp_get_reply_id();
    26         $test  = (int) ( $forum . $topic . $reply );
     28        $ids = $this->get_vars();
     29        foreach ( $ids as $title => $value ) {
     30            if ( ! empty( $value ) )
     31                echo '<h2>' . sprintf( "<span>%s:</span>%d", $title, $value ) . '</h2>';
     32        }
    2733
    28         if ( ! empty( $test ) ) {
    29 
    30 
    31             if ( ! empty( $forum ) )
    32                 echo '<h2>' . sprintf( __( "<span>Forum ID:</span>%d", "bbp-debug-bar" ), $forum ) . '</h2>';
    33 
    34             if ( ! empty( $topic ) )
    35                 echo '<h2>' . sprintf( __( "<span>Topic ID:</span>%d", "bbp-debug-bar" ), $topic ) . '</h2>';
    36 
    37             if ( ! empty( $reply ) )
    38                 echo '<h2>' . sprintf( __( "<span>Reply ID:</span>%d", "bbp-debug-bar" ), $reply ) . '</h2>';
    39         }
    4034
    4135        echo '<br/>';
     
    5347    }
    5448
     49
     50
     51
     52
     53
     54
     55
     56
    5557    /* Helper methods */
    5658
    5759    public function log_template_part( $templates, $slug, $name ) {
    58         $this->templates[] = $templates[0];
     60        $this->templates[] = ;
    5961        return $templates;
    6062    }
  • debug-bar-bbpress/trunk/debug-bar-bbress.php

    r687099 r687254  
    55Description: Helps debug bbPress using the Debug Bar
    66Author: Daniel Dvorkin
    7 Version: 0.1.
     7Version: 0.
    88Author URI: http://danieldvork.in
    99*/
  • debug-bar-bbpress/trunk/readme.txt

    r687099 r687254  
    44Requires at least: 3.1
    55Tested up to: 3.5.1
    6 Stable tag: 0.1
     6Stable tag: 0.
    77
    88Displays information about the bbPress runtime in the Debug Bar.
     
    2626== Changelog ==
    2727
    28 = 0.0.1 =
     28= 0.1.1 =
     29* Show full path to template instead of just name,so it's easier to spot overrides.
     30* Introduce filter 'bbp-debug-bar-vars' to add vars at the top (like Forum or Topic ID)
     31* Hide the panels if there's nothing to show, like outside bbp pages. (Thanks JJJ)
     32
     33= 0.1 =
    2934
    3035Initial release
Note: See TracChangeset for help on using the changeset viewer.