33 lines
821 B
PHP
33 lines
821 B
PHP
<?php
|
|
/**
|
|
* GeneratePress child theme functions and definitions.
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* Basic logging function for debugging. Allows passing of an object or array for the $data paramater
|
|
*
|
|
* Set the CUSTOM_DEBUG_LOG file in wp-config.php
|
|
*
|
|
*/
|
|
|
|
/*
|
|
function log_to_file($message = false, $data = false){
|
|
if ($message) {
|
|
$log_File = CUSTOM_DEBUG_LOG;
|
|
|
|
$date = new DateTime();
|
|
$date = $date->format("Y/m/d h:i:s");
|
|
|
|
// Convert arrays and objects to JSON format
|
|
if (is_array($data) || is_object($data)) {
|
|
$data = json_encode($data);
|
|
$message = $message . " " . $data;
|
|
} else if ($data) {
|
|
$message = $message . " " . $data;
|
|
}
|
|
|
|
error_log("[$date] " . $message ."\r\n",3,$log_File);
|
|
}
|
|
}
|
|
*/
|