Filter hook 'wp_php_error_args'

in WP Core File wp-includes/class-wp-fatal-error-handler.php at line 235

View Source

wp_php_error_args

Filter Hook
Description
Filters the arguments passed to {@see wp_die()} for the default PHP error template.

Hook Information

File Location wp-includes/class-wp-fatal-error-handler.php View on GitHub
Hook Type Filter
Line Number 235

Hook Parameters

Type Name Description
array $args Associative array of arguments passed to `wp_die()`. By default these contain a 'response' key, and optionally 'link_url' and 'link_text' keys.
array $error Error information retrieved from `error_get_last()`.

Usage Examples

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

function my_custom_filter($args, $error) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-includes/class-wp-fatal-error-handler.php:235 - How this hook is used in WordPress core
<?php
 230  		 *
 231  		 * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a
 232  		 *                    'response' key, and optionally 'link_url' and 'link_text' keys.
 233  		 * @param array $error Error information retrieved from `error_get_last()`.
 234  		 */
 235  		$args = apply_filters( 'wp_php_error_args', $args, $error );
 236  
 237  		$wp_error = new WP_Error(
 238  			'internal_server_error',
 239  			$message,
 240  			array(

PHP Documentation

<?php
/**
		 * Filters the arguments passed to {@see wp_die()} for the default PHP error template.
		 *
		 * @since 5.2.0
		 *
		 * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a
		 *                    'response' key, and optionally 'link_url' and 'link_text' keys.
		 * @param array $error Error information retrieved from `error_get_last()`.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-fatal-error-handler.php
Related Hooks

Related hooks will be displayed here in future updates.