numargs = func_num_args(); $this->plugin_value = func_get_args(); if ( $this->numargs ) { $this->out = $this->process(true); echo( "" ); } } function table() { $this->numargs = func_num_args(); $this->plugin_value = func_get_args(); if ( $this->numargs ) { $this->out = $this->process(false); echo( "" ); } } function json() { $this->numargs = func_num_args(); $this->plugin_value = func_get_args(); if ( $this->numargs ) { $this->out = $this->process(false); echo( "" ); } } function time() { $this->numargs = func_num_args(); $this->plugin_value = func_get_args(); if ( $this->numargs ) { $this->out = $this->plugin_value[0]; echo( "" ); } else { echo( "" ); } } function timeEnd() { $this->numargs = func_num_args(); $this->plugin_value = func_get_args(); if ( $this->numargs ) { $this->out = $this->plugin_value[0]; echo( "" ); } else { echo( "" ); } } private function process($mode) { for ($i = 0; $i < $this->numargs; $i++) { if (is_array($this->plugin_value[$i]) || is_object($this->plugin_value[$i])) { if ($mode) { /* Your choice of output. */ /** * about print_r() */ $this->plugin_value[$i] = print_r( $this->plugin_value[$i], true ); /** * about var_export() */ //$this->plugin_value[$i] = var_export( $this->plugin_value[$i], true ); /** * about var_dump() Output Buffering */ //ob_start(); var_dump( $this->plugin_value[$i] ); $this->plugin_value[$i] = ob_get_contents(); ob_end_clean(); } $this->plugin_value[$i] = json_encode($this->plugin_value[$i]); if ( $i === 0 ) { $this->plugin_out = $this->plugin_value[$i]; } else { $this->plugin_out .= ',' . $this->plugin_value[$i]; } } else { if ( $i === 0 ) { $this->plugin_out .= '"wp: "+"' . $this->plugin_value[$i] . '"'; } else { $this->plugin_out .= ', "' . $this->plugin_value[$i] . '"'; } } } return $this->plugin_out; } } ?>