Hello @vaidehiimedia,
Thank you for writing to us. There is no option to delete the user. Though you can use our hook to invoke a custom function call when a submission is deleted. Here is the sample code:
add_action(‘erf_submission_deleted’,’handle_deletion’,10,3);
function handle_deletion($form,$submission,$user){
// Custom code to delete the user.
}
Thank you for your reply.
Hello,
require_once ERFORMS_PLUGIN_DIR . ‘erforms.php’;
$user = wp_get_current_user();
$userId = $user->ID;
$formID = get_user_meta($userId, ‘erf_form’, true);
$submissionID = get_user_meta($userId, ‘erf_submission’, true);
$form = erforms()->form->get_form($formID);
$submission = erforms()->submission->get_submission($submissionID);
add_action(‘erf_submission_deleted’,’handle_deletion’,10,3);
function handle_deletion($form,$submission,$user){
// Custom code to delete the user.
delete_user_meta($userId, ‘erf_submission’, $submissionID);
wp_logout();
}
I added this code in theme’s functions.php file but the action is not being called when submission is getting deleted.
Can you let me know what I am doing wrong?
Thanks,
Vaidehi