wp_fatal_error_handler_enabled
Filter HookDescription
Filters whether the fatal error handler is enabled. **Important:** This filter runs before it can be used by plugins. It cannot be used by plugins, mu-plugins, or themes. To use this filter you must define a `$wp_filter` global before WordPress loads, usually in `wp-config.php`. Example: $GLOBALS['wp_filter'] = array( 'wp_fatal_error_handler_enabled' => array( 10 => array( array( 'accepted_args' => 0, 'function' => function() { return false; }, ), ), ), ); Alternatively you can use the `WP_DISABLE_FATAL_ERROR_HANDLER` constant.Hook Information
File Location |
wp-includes/error-protection.php
View on GitHub
|
Hook Type | Filter |
Line Number | 139 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$enabled
|
True if the fatal error handler is enabled, false otherwise. |
Usage Examples
Basic Usage
<?php
// Hook into wp_fatal_error_handler_enabled
add_filter('wp_fatal_error_handler_enabled', 'my_custom_filter', 10, 1);
function my_custom_filter($enabled) {
// Your custom filtering logic here
return $enabled;
}
Source Code Context
wp-includes/error-protection.php:139
- How this hook is used in WordPress core
<?php
134 *
135 * @since 5.2.0
136 *
137 * @param bool $enabled True if the fatal error handler is enabled, false otherwise.
138 */
139 return apply_filters( 'wp_fatal_error_handler_enabled', $enabled );
140 }
141
142 /**
143 * Access the WordPress Recovery Mode instance.
144 *
PHP Documentation
<?php
/**
* Filters whether the fatal error handler is enabled.
*
* **Important:** This filter runs before it can be used by plugins. It cannot
* be used by plugins, mu-plugins, or themes. To use this filter you must define
* a `$wp_filter` global before WordPress loads, usually in `wp-config.php`.
*
* Example:
*
* $GLOBALS['wp_filter'] = array(
* 'wp_fatal_error_handler_enabled' => array(
* 10 => array(
* array(
* 'accepted_args' => 0,
* 'function' => function() {
* return false;
* },
* ),
* ),
* ),
* );
*
* Alternatively you can use the `WP_DISABLE_FATAL_ERROR_HANDLER` constant.
*
* @since 5.2.0
*
* @param bool $enabled True if the fatal error handler is enabled, false otherwise.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/error-protection.php
Related Hooks
Related hooks will be displayed here in future updates.