Skip to content

Instantly share code, notes, and snippets.

@webzunft
Last active Dec 18, 2015
Embed
What would you like to do?
function to log events for themes in WordPress functions.php
/* LOG FUNCTION */
function log( $input ){
$time = date('d-m-Y H:i T');
$file = get_template_directory() . '/log.txt';
$handle = fopen($file, 'a');
$data = '--------------- ' . $time."--------------- \r\n".$input."\r\n";
fwrite($handle, $data);
fclose($handle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment