enable_wp_debug_mode_checks
Filter HookDescription
Filters whether to allow the debug mode check to occur. This filter runs before it can be used by plugins. It is designed for non-web runtimes. Returning false causes the `WP_DEBUG` and related constants to not be checked and the default PHP values for errors will be used unless you take care to update them yourself. To use this filter you must define a `$wp_filter` global before WordPress loads, usually in `wp-config.php`. Example: $GLOBALS['wp_filter'] = array( 'enable_wp_debug_mode_checks' => array( 10 => array( array( 'accepted_args' => 0, 'function' => function() { return false; }, ), ), ), );Hook Information
File Location |
wp-includes/load.php
View on GitHub
|
Hook Type | Filter |
Line Number | 605 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$enable_debug_mode
|
Whether to enable debug mode checks to occur. Default true. |
Usage Examples
Basic Usage
<?php
// Hook into enable_wp_debug_mode_checks
add_filter('enable_wp_debug_mode_checks', 'my_custom_filter', 10, 1);
function my_custom_filter($enable_debug_mode) {
// Your custom filtering logic here
return $enable_debug_mode;
}
Source Code Context
wp-includes/load.php:605
- How this hook is used in WordPress core
<?php
600 *
601 * @since 4.6.0
602 *
603 * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.
604 */
605 if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ) {
606 return;
607 }
608
609 if ( WP_DEBUG ) {
610 error_reporting( E_ALL );
PHP Documentation
<?php
/**
* Filters whether to allow the debug mode check to occur.
*
* This filter runs before it can be used by plugins. It is designed for
* non-web runtimes. Returning false causes the `WP_DEBUG` and related
* constants to not be checked and the default PHP values for errors
* will be used unless you take care to update them yourself.
*
* To use this filter you must define a `$wp_filter` global before
* WordPress loads, usually in `wp-config.php`.
*
* Example:
*
* $GLOBALS['wp_filter'] = array(
* 'enable_wp_debug_mode_checks' => array(
* 10 => array(
* array(
* 'accepted_args' => 0,
* 'function' => function() {
* return false;
* },
* ),
* ),
* ),
* );
*
* @since 4.6.0
*
* @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/load.php
Related Hooks
Related hooks will be displayed here in future updates.