With WordPress 3.0 debugging will be easier, whereas one constants gets eliminated and an already existing constant will do their work.
For developers the following 3 constants are important and should exist in every wp-config.php of a development system. Please use it with precaution on a live system!
Add
define('WP_DEBUG', true);
to wp-config.php to enable
the reporting of notices during development.Add
define('WP_DEBUG_DISPLAY', false);
to wp-config.php to
disable the display of errors.Add
define('WP_DEBUG_LOG', true);
to wp-config.php to log
eerrors to debug.log in the wp-content directory.
Sets PHP error handling and handles WordPress debug mode.
Recommendation for wp-config.php
/** Debugging WP */
define('WP_DEBUG', true); //enable the reporting of notices during development - E_ALL
define('WP_DEBUG_DISPLAY', true); //use the globally configured setting for display_errors and not force errors to be displayed
define('WP_DEBUG_LOG', true); //error logging to wp-content/debug.log
define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS and disables compression and concatenation,
//define('E_DEPRECATED', true); //E_ALL & ~E_DEPRECATED & ~E_STRICT
A small syntax with huge impact. I recommend this to everyone who is developing with WordPress, especially with Xdebug a fantastic help.
Comments
One response to “WordPress Developer Hint”
I feel a lot more people need to read this, very good info! . . . . . .