Filter hook 'deprecated_hook_trigger_error'

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

View Source

deprecated_hook_trigger_error

Filter Hook
Description
Filters whether to trigger deprecated hook errors.

Hook Information

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

Hook Parameters

Type Name Description
bool $trigger Whether to trigger deprecated hook errors. Requires `WP_DEBUG` to be defined true.

Usage Examples

Basic Usage
<?php
// Hook into deprecated_hook_trigger_error
add_filter('deprecated_hook_trigger_error', 'my_custom_filter', 10, 1);

function my_custom_filter($trigger) {
    // Your custom filtering logic here
    return $trigger;
}

Source Code Context

wp-includes/functions.php:5960 - How this hook is used in WordPress core
<?php
5955  	 * @since 4.6.0
5956  	 *
5957  	 * @param bool $trigger Whether to trigger deprecated hook errors. Requires
5958  	 *                      `WP_DEBUG` to be defined true.
5959  	 */
5960  	if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
5961  		$message = empty( $message ) ? '' : ' ' . $message;
5962  
5963  		if ( $replacement ) {
5964  			$message = sprintf(
5965  				/* translators: 1: WordPress hook name, 2: Version number, 3: Alternative hook name. */

PHP Documentation

<?php
/**
	 * Filters whether to trigger deprecated hook errors.
	 *
	 * @since 4.6.0
	 *
	 * @param bool $trigger Whether to trigger deprecated hook errors. Requires
	 *                      `WP_DEBUG` to be defined true.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.