Changeset 687254
- Timestamp:
- 03/25/2013 11:22:52 PM (11 years ago)
- Location:
- debug-bar-bbpress/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
debug-bar-bbpress/trunk/class-debug-bar-bbpress.php
r687099 r687254 16 16 17 17 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 ); 19 24 } 20 25 21 26 public function render() { 22 27 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 } 27 33 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 }40 34 41 35 echo '<br/>'; … … 53 47 } 54 48 49 50 51 52 53 54 55 56 55 57 /* Helper methods */ 56 58 57 59 public function log_template_part( $templates, $slug, $name ) { 58 $this->templates[] = $templates[0];60 $this->templates[] = ; 59 61 return $templates; 60 62 } -
debug-bar-bbpress/trunk/debug-bar-bbress.php
r687099 r687254 5 5 Description: Helps debug bbPress using the Debug Bar 6 6 Author: Daniel Dvorkin 7 Version: 0. 1.7 Version: 0. 8 8 Author URI: http://danieldvork.in 9 9 */ -
debug-bar-bbpress/trunk/readme.txt
r687099 r687254 4 4 Requires at least: 3.1 5 5 Tested up to: 3.5.1 6 Stable tag: 0. 16 Stable tag: 0. 7 7 8 8 Displays information about the bbPress runtime in the Debug Bar. … … 26 26 == Changelog == 27 27 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 = 29 34 30 35 Initial release
Note: See TracChangeset
for help on using the changeset viewer.