dump_html_tree

The BP Groupblog dump html tree function.

Description

dump_html_tree( $node, (constant) $show_attr = true, (int) $deep = 0 ); 

Parameters (3)

0. $node
The node.
1. $show_attr — Optional. (constant) => true
The show attr.
2. $deep — Optional. (int)
The deep.

Usage

  1. if ( !function_exists( 'dump_html_tree' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-groupblog/themes/p2-buddypress/groupblog/_inc/simple_html_dom.php'; 
  3.  
  4. // The node. 
  5. $node = null; 
  6.  
  7. // The show attr. 
  8. $show_attr = true; 
  9.  
  10. // The deep. 
  11. $deep = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = dump_html_tree($node, $show_attr, $deep); 
  15.  

Defined (1)

The function is defined in the following location(s).

/themes/p2-buddypress/groupblog/_inc/simple_html_dom.php  
  1. function dump_html_tree($node, $show_attr=true, $deep=0) { 
  2. $lead = str_repeat(' ', $deep); 
  3. echo $lead.$node->tag; 
  4. if ($show_attr && count($node->attr)>0) { 
  5. echo '('; 
  6. foreach($node->attr as $k=>$v) 
  7. echo "[$k]=>\"".$node->$k.'", '; 
  8. echo ')'; 
  9. echo "\n"; 
  10.  
  11. foreach($node->nodes as $c) 
  12. dump_html_tree($c, $show_attr, $deep+1);