wp_debug_mode [ WordPress Function ]
| Access: |
|
| Defined at: |
|
Sets PHP error handling and handles WordPress debug mode.
Uses three constants: WP_DEBUG, WP_DEBUG_DISPLAY, and WP_DEBUG_LOG. All three can be defined in wp-config.php. Example:
define( 'WP_DEBUG', true );
WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless WP_DEBUG is true. WP_DEBUG defaults to false.
When WP_DEBUG is true, all PHP notices are reported. WordPress will also display notices, including one when a deprecated WordPress function, function argument, or file is used. Deprecated code may be removed from a later version.
It is strongly recommended that plugin and theme developers use WP_DEBUG in their development environments.
When WP_DEBUG_DISPLAY is true, WordPress will force errors to be displayed. WP_DEBUG_DISPLAY defaults to true. Defining it as null prevents WordPress from changing the global configuration setting. Defining WP_DEBUG_DISPLAY as false will force errors to be hidden.
When WP_DEBUG_LOG is true, errors will be logged to wp-content/debug.log. WP_DEBUG_LOG defaults to false.
Source
<?php
function wp_debug_mode() {
if ( WP_DEBUG ) {
// E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.
// The two statements are equivalent, just one is for 5.3+ and for less than 5.3.
if ( defined( 'E_DEPRECATED' ) )
error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
else
error_reporting( E_ALL );
if ( WP_DEBUG_DISPLAY )
ini_set( 'display_errors', 1 );
elseif ( null !== WP_DEBUG_DISPLAY )
ini_set( 'display_errors', 0 );
if ( WP_DEBUG_LOG ) {
ini_set( 'log_errors', 1 );
ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
}
} else {
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/wp debug mode « WordPress Codex
Description. Sets PHP error handling and handles WordPress debug mode. Uses three constants: WP_DEBUG, WP_DEBUG_DISPLAY, and WP_DEBUG_LOG.
codex.wordpress.org - [Plugin: Now Reading Reloaded] Error Adding Book - WordPress
Jan 1, 2010 ... Did you turn on WP's debug mode, or NR's debug mode? ... WP debug mode isn't really helpful; what does the NR debug mode (available on ...
wordpress.org - [Plugin: WordPress.com Stats] Errors in WP debug mode
[Plugin: WordPress.com Stats] Errors in WP debug mode (1 post). opajaap · Member Posted 1 year ago #. While debug is on, the following error is shown in the ...
wordpress.org - PHPXRef 0.7 : WordPress : Function Reference: wp_debug_mode()
Function and Method Cross Reference. wp_debug_mode(). Defined at: /wp- includes/load.php -> line 233. Referenced 1 times: /wp-settings.php -> line 58 ...
phpxref.ftwr.co.uk