Skip to content

Instantly share code, notes, and snippets.

/**
* Strip EXIF data from images upon upload.
*/
add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' );
function custom_upload_filter( $file ){
$image = $file['tmp_name'];
try
// Check that required variables exist
if( ( process.argv[2] == undefined ) || ( process.argv[3] == undefined ) ){
console.log('Missing variables')
console.log('1, local path to coverage file. 2, url to target css file')
return;
}
(async () => {
var fs = require("fs");