Skip to content
Dev Kabir edited this page Oct 26, 2024 · 2 revisions

How to use this plugin?

Functions to call.

/**
* Logs a message to a specified directory.
*
* @param mixed $message The message to be logged.
* @param bool $trace Whether to log the backtrace.
* @param string $dir The directory where the log file will be written.
*
* @return void
* @throws \Exception
*/
function write_log( $message, bool $trace = false, string $dir = WP_CONTENT_DIR ) {}

/**
* Debug from called spot.
*
* @return void
* @throws Exception
*/
function init_debugger() {}

/**
* Outputs a formatted dump of a variable for debugging purposes.
*
* @param mixed $variable The variable to dump.
* @return void
*/
function dump( $variable ){}

/**
* Dump a variable and stop execution.
*
* @return void
*/
function dd( $data ) {}

Filter hooks

/**
* Filter to push data into the debug bar contents.
*
* @param array $contents Collection of debug data.
*/
add_filter( 'wp_debugger_contents', function( array $contents ) {
  return $contents;
});

Clone this wiki locally