All features

Cherry Blossom feature

Framework Traits: Dump trait

Provides immediate, buffered and deferred diagnostic output.

Provides immediate, buffered and deferred diagnostic output.

Capabilities and extension points

Provides immediate, buffered and deferred diagnostic output.

Compose with Debugging or provide is_web(). Dumps are unescaped diagnostic output; the optional WP_DEBUG gate defaults to false.

Prints a diagnostic value in the selected format.

  • param mixed $var Diagnostic value.
  • param bool $wp_debug_only Optional. Requires WP_DEBUG when true. Default false.
  • param string $type Optional. json, print_r or var_dump. Default var_dump.
  • param bool|null $pre Optional. Adds pre tags; null detects web output. Default null.

Captures diagnostic output without printing it.

  • param mixed $var Diagnostic value.
  • param bool $wp_debug_only Optional. Requires WP_DEBUG when true. Default false.
  • param string $type Optional. json, print_r or var_dump. Default var_dump.
  • param bool $pre Optional. Adds pre tags. Default false.
  • return string var_dump output.

Schedules diagnostic output for the frontend and applicable admin footer.

  • param mixed $var Diagnostic value.
  • param bool $wp_debug_only Optional. Requires WP_DEBUG when true. Default false.
  • param string $type Optional. json, print_r or var_dump. Default var_dump.

Prints a diagnostic value and terminates through wp_die().

When the requested debug gate is disabled, neither output nor termination occurs.

  • param mixed $var Diagnostic value.
  • param bool $wp_debug_only Optional. Requires WP_DEBUG when true. Default false.
  • param string $type Optional. json, print_r or var_dump. Default var_dump.

Delegates to the diagnostic dump-and-terminate helper.

  • param mixed $var Diagnostic value.
  • param bool $wp_debug_only Optional. Requires WP_DEBUG when true. Default false.
  • param string $type Optional. json, print_r or var_dump. Default var_dump.
  • see dump_die()

Source reference

This editable reference page is based on the PHP documentation in framework/traits/debugging/trait-dump.php.