Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active May 25, 2018 18:15
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 Shelob9/f1e2aaf901d602ec299ac455418588b7 to your computer and use it in GitHub Desktop.
Save Shelob9/f1e2aaf901d602ec299ac455418588b7 to your computer and use it in GitHub Desktop.
<?php
/**
* Change the data exporter and eraser for one Caldera Form
*
* #GPDR
*/
add_filter( 'caldera_forms_gdpr_callback',
function($defualt_callback, $type, $form_id ){
//IMPORTANT: Change form ID or remove conditional to change for all forms
if ( 'CF12345' === $form_id ) {
switch ($type){
case 'exporter':
//Callable reference to function that will process the export request for this form.
return 'my_caldera_forms_gdpr_exporter';
break;
case 'eraser':
default:
//Callable reference to function that will process the eraser request for this form.
return 'my_caldera_forms_gdpr_eraser';
break;
}
}
//Return default unmodified if conditions not met.
return $defualt_callback;
},
10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment