Hook into BuddyForms during form submission
You can hook into BuddyForms during form submission to manipulate form data or support custom form elements. BuddyForms does offer 2 different hooks to do that.
Hooks
1. buddyforms_after_save_post will run just after the post is created or updated.
do_action('buddyforms_after_save_post', $post_id);
Parameters
- $customfield (Array) The current processed form element
2. buddyforms_update_post_meta will run just before every form element will be saved as custom post meta.
do_action('buddyforms_update_post_meta',$customfield, $post_id);
Parameters
- $customfield (Array) The current processed form element
Structure: Array ( [required] => Array ( [0] => ) [name] => [slug] => [description] => [type] => [order] => ... )
- $post_id (integer) The ID of the post
Acces Form Data
All submitted values are available in the $_POST. Also if ajax is enabled the $_POST gets created for compatibility reasons. All form data can be accessed with the form element slug.
Filter
To filter the post arguments just before the post gets created or updated please use this filter: buddyforms_update_post_args