Last active
August 29, 2023 18:03
-
-
Save alex-authlab/caaac513e9da214c08e7112e2d82de91 to your computer and use it in GitHub Desktop.
Fluent Form Entry Delete Bulk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* insert in function.php & remove the code after deleting entries | |
*/ | |
add_action( 'plugins_loaded', function(){ | |
$formId= 8; // add your form ID | |
$startId = 20; // Entry Delete start from this ID | |
$endId = 21; // Entry Delete end with this ID | |
delete_entry($formId,$startId,$endId); | |
} ); | |
function delete_entry($formId,$start,$end) { | |
$delete = wpFluent()->table('fluentform_submissions') | |
->where('form_id', $formId) | |
->where('serial_number', '>=', $start) | |
->where('serial_number', '<=', $end) | |
->delete(); | |
if($delete){ | |
$message ='<div class="notice notice-success "> | |
<p>Fluent Form Entry Deleted.</p> | |
</div>'; | |
}else{ | |
$message ='<div class="notice notice-error "><p> Fluent Form Entries Deletion Error! </b></p></div>'; | |
} | |
add_action( 'admin_notices', function($message){ | |
echo $message; | |
} ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not Working.