Skip to content

Instantly share code, notes, and snippets.

@anthonysbrown
Last active November 29, 2017 19:11
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 anthonysbrown/1a36e58ac2efce5ac9be5f65d8780bcb to your computer and use it in GitHub Desktop.
Save anthonysbrown/1a36e58ac2efce5ac9be5f65d8780bcb to your computer and use it in GitHub Desktop.
hook into cdm after file upload
add_action('sp_cdm_after_file_upload','custom_cdm_after_file_upload',10,2);
function custom_cdm_after_file_upload($target_path,$uid){
$pass = true;
#do some validation
if($somethignisntright){
$pass = false;
}
#end do some validation
if($pass == false){
die('{"OK": 0, "info": "CSV failed validation."}');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment