Created
February 26, 2025 14:58
-
-
Save cdsaenz/b260041019484c89f05327531db7761c to your computer and use it in GitHub Desktop.
WordPress wp-config.php settings for development (avoid logging deprecated and notices)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
define( 'FS_METHOD', 'direct' ); | |
// Adjust as per your server/php memory | |
define( 'WP_MEMORY_LIMIT', '1024M' ); | |
// Don't log deprecated errors etc | |
function csdev_error_handler($errno, $errstr, $errfile, $errline) | |
{ | |
if ($errno == E_DEPRECATED | |
|| $errno == E_USER_DEPRECATED | |
|| $errno == E_NOTICE | |
|| $errno = E_USER_NOTICE) { | |
return true; | |
} | |
// Let WordPress handle other errors normally | |
return false; | |
} | |
set_error_handler('csdev_error_handler'); | |
/* That's all, stop editing! Happy publishing. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment