doing_it_wrong_trigger_error filter-hookWP 3.1.0

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 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, $message, $version ){

	// filter...
	return $trigger;
}
$trigger(true|false)
Whether to trigger the error for _doing_it_wrong() calls.
Default: true
$function(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, $message and $version parameters.

Where the hook is called

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

Where the hook is used in WordPress

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