Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Updates the wp_forms table whenever a user sends a form
- */
- function add_form_to_table(){
- global $wpdb;
- $sender_id = get_current_user_id();
- $form_type = $_POST['form_name'];
- $form_data = $_POST;
- unset($form_data['submit']);
- unset($form_data['action']);
- unset($form_data['security']);
- $date = date("d-m-y H:i:s", time());
- if(!is_serialized($form_data)) :
- $data = serialize($form_data);
- endif;
- $data = compact('sender_id', 'form_type', 'form_data', 'date');
- $wpdb->insert('wp_forms', $data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement