Skip to content

Instantly share code, notes, and snippets.

@mjones129
Created April 25, 2024 18:13
Show Gist options
  • Save mjones129/8c83c396666ba91741de0b6b9f7967e8 to your computer and use it in GitHub Desktop.
Save mjones129/8c83c396666ba91741de0b6b9f7967e8 to your computer and use it in GitHub Desktop.
Check File Mod Time On Page Load
add_action('wp', 'test');
function test() {
//get file modified time of style.css
$time = filemtime('./style.css');
$msg = "style.css was modified at: " . $time;
$log_file = fopen(ABSPATH . '/theme_file_edit_logs.txt', 'a');
fwrite($log_file, $msg);
fclose($log_file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment