Output name of the traced variable
-
Hi from Germany,
first of all: Nice addition, this will be in my toolbox from now on. Thank you for building this. I enclosed your do_action in a wrapper function like this:
if(!function_exists('ss_debug')){ function ss_debug($var,$label = ''){ if(!isset($var)){ return; } if(empty($label)){ $label = __('Debug info'); } if(class_exists('Debug_Bar_Custom_Info')){ do_action( 'add_debug_info', $var, $label ); return; } echo '<p><b>'.$label.'</b></p><pre>'; print_r($var); echo '</pre>'; } }
What I think would make a good addition to this would be printing out the name of the given variable. In case of your action call, I would like to print out something like
echo $label.'The value of the variable $var is now'.$var;
Any Idea how to achieve this?
- The topic ‘Output name of the traced variable’ is closed to new replies.