doing_it_wrong_trigger_error filter-hookWP 3.1.0

Filters whether to trigger an error for _doing_it_wrong() calls.

Usage

add_filter( 'doing_it_wrong_trigger_error', 'wp_kama_doing_it_wrong_trigger_error_filter', 10, 4 );

/**
 * Function for `doing_it_wrong_trigger_error` filter-hook.
 * 
 * @param bool   $trigger       Whether to trigger the error for _doing_it_wrong() calls.
 * @param string $function_name The function that was called.
 * @param string $message       A message explaining what has been done incorrectly.
 * @param string $version       The version of WordPress where the message was added.
 *
 * @return bool
 */
function wp_kama_doing_it_wrong_trigger_error_filter( $trigger, $function_name, $message, $version ){

	// filter...
	return $trigger;
}
$trigger(true|false)
Whether to trigger the error for _doing_it_wrong() calls.
Default: true
$function_name(string)
The function that was called.
$message(string)
A message explaining what has been done incorrectly.
$version(string)
The version of WordPress where the message was added.

Changelog

Since 3.1.0 Introduced.
Since 5.1.0 Added the $function_name, $message and $version parameters.

Where the hook is called

_doing_it_wrong()
doing_it_wrong_trigger_error
wp-includes/functions.php 5991
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function_name, $message, $version ) ) {

Where the hook is used in WordPress

wp-includes/rest-api.php 219
add_filter( 'doing_it_wrong_trigger_error', '__return_false' );