Action hook 'wp_trigger_error_run'

in WP Core File wp-includes/functions.php at line 6099

View Source

wp_trigger_error_run

Action Hook
Description
Fires when the given function triggers a user-level error/warning/notice/deprecation message. Can be used for debug backtracking.

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Action
Line Number 6099

Hook Parameters

Type Name Description
string $function_name The function that was called.
string $message A message explaining what has been done incorrectly.
int $error_level The designated error type for this error.

Usage Examples

Basic Usage
<?php
// Hook into wp_trigger_error_run
add_action('wp_trigger_error_run', 'my_custom_function', 10, 3);

function my_custom_function($function_name, $message, $error_level) {
    // Your custom code here
}

Source Code Context

wp-includes/functions.php:6099 - How this hook is used in WordPress core
<?php
6094  	 *
6095  	 * @param string $function_name The function that was called.
6096  	 * @param string $message       A message explaining what has been done incorrectly.
6097  	 * @param int    $error_level   The designated error type for this error.
6098  	 */
6099  	do_action( 'wp_trigger_error_run', $function_name, $message, $error_level );
6100  
6101  	if ( ! empty( $function_name ) ) {
6102  		$message = sprintf( '%s(): %s', $function_name, $message );
6103  	}
6104  

PHP Documentation

<?php
/**
	 * Fires when the given function triggers a user-level error/warning/notice/deprecation message.
	 *
	 * Can be used for debug backtracking.
	 *
	 * @since 6.4.0
	 *
	 * @param string $function_name The function that was called.
	 * @param string $message       A message explaining what has been done incorrectly.
	 * @param int    $error_level   The designated error type for this error.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.