Skip to content

Instantly share code, notes, and snippets.

@webzunft
Last active December 18, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webzunft/5780769 to your computer and use it in GitHub Desktop.
Save webzunft/5780769 to your computer and use it in GitHub Desktop.
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