wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true
functions.php
if(!function_exists('_log')){
function _log($message) {
if (WP_DEBUG === true) {
if (is_array($message) || is_object($message)) {
error_log(print_r($message, true));
} else {
error_log($message);
}
}
}
以上のコードをfunction.php wpconfig.phpに加えることで _log ()によってデバッグの内容をwp-content/debug.log に出力できます


