In most of the PHP hooks provided without support, there are numbers referenced in the first line, but not explained. Similar number entries are explained later in each code snippet.
What doe these 2 numbers represent. Can someone please enlighten me on what 42, 2 are. I'm assuming they would change based on something with my forms.
#add_action('frm_after_create_entry', 'after_entry_created', 42, 2);
#function after_entry_created($entry_id, $form_id){
#if ( $form_id == 5 ) { //change 5 to the ID of your form
#FrmEntryMeta::delete_entry_meta($entry_id, 30); // change 30 to your field id
#}
#}
The execution order of WordPress hooks can be prioritized. The first number, 40, is the priority. The default priority for all WordPress hooks is 10. The higher the number the later in the execution path the filter is processed. The second number is the number of parameters the filter passes to the callback. The first parameter is the returned value for a filter, actions do not return values. See this: https://developer.wordpress.org/plugins/hooks/
THanks for that - I've added it to my code snippets and verified my form and field ID are correct, but it's not deleting the checkbox response for the field ID I identified. Or would it work better if it was a text field?
No, the field type shouldn't matter. If the metadata is not being deleted, are you certain the $entry_id is correct and that there's a value in the database that can be deleted for that entry. Formidable does not store values for which there is no default value or user provided values.
I'm trying to create a checkbox that would trigger an email, but NOT save so it's blank or unchecked the next time they go into the form to update it. So the checkbox is blank, they check it, update the file, it triggers the email, but then, hopefully, deletes the entry for that field so it's unchecked again next time they come in.
Please login or Register to submit your answer