HelloThis is a presentation on the versatilityof Gravity Forms in WordPress.http://www.gravityhelp.com/documentation/page/...
HelloChecking a table within our databaseand validation our form.http://www.gravityhelp.com/documentation/page/Gform_valid...
Hello     add_filter(gform_validation, code_validation);     function code_validation($validation_result){            // s...
HelloClient Portal & Email Author of pagehttp://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name@i...
Hellogform_ eld_value_$parameter_nameUse this lter to add a default value to the eld speci ed by $parameter_name.     add_...
GoodbyeResources & Plugins• Gravity Forms Download• Gravity Forms Documentation• Gravity Forms + Custom Post Types Plugin•...
Upcoming SlideShare
Loading in …5
×

Gravity Forms Hooks & Filters

8,639 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
8,639
On SlideShare
0
From Embeds
0
Number of Embeds
2,115
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Gravity Forms Hooks & Filters

  1. 1. HelloThis is a presentation on the versatilityof Gravity Forms in WordPress.http://www.gravityhelp.com/documentation/page/Developer_Docs@iamdangavin | iamdangavin@gmail.com
  2. 2. HelloChecking a table within our databaseand validation our form.http://www.gravityhelp.com/documentation/page/Gform_validation@iamdangavin | iamdangavin@gmail.com
  3. 3. Hello add_filter(gform_validation, code_validation); function code_validation($validation_result){ // setting up to check against out database. global $wpdb; $input = $_POST[input_5]; $code_check = $wpdb->get_results("SELECT code FROM code_check WHERE code ="$input""); foreach($code_check as $row){ $code = $row->code; } //end foreach if($code != $input){ // set the form validation to false $validation_result["is_valid"] = false; //finding Field with ID of 1 and marking it as failed validation foreach($validation_result["form"]["fields"] as &$field){ /NOTE: replace 5 with the field you would like to validate if($field["id"] == "5"){ $field["failed_validation"] = true; $field["validation_message"] = "Sorry, That code has either been used before or incorrect. Please try again!"; break; } //end if } //end foreach } //end if return $validation_result; } //End function_exists@iamdangavin | iamdangavin@gmail.com
  4. 4. HelloClient Portal & Email Author of pagehttp://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name@iamdangavin | iamdangavin@gmail.com
  5. 5. Hellogform_ eld_value_$parameter_nameUse this lter to add a default value to the eld speci ed by $parameter_name. add_filter(gform_field_value_current_client_ID, hidden_current_client_ID); function hidden_current_client_ID($value){ global $curauth; return $curauth->ID; }gform_noti cation_emailUse this lter to dynamically change the TO email for admin noti cation. // Hook to send the author an email that a message has been sent to them // Update the 1 in the gform_notification_email to your form ID. If you would like this to be a global change, remove the _1. add_filter("gform_notification_email_1", "change_notification_email", 10, 2); function change_notification_email($email, $form){ // update the 5 to the ID of your field $email = $_POST[input_5]; return $email; }@iamdangavin | iamdangavin@gmail.com
  6. 6. GoodbyeResources & Plugins• Gravity Forms Download• Gravity Forms Documentation• Gravity Forms + Custom Post Types Plugin• Gravity Forms CSS@iamdangavin | iamdangavin@gmail.com

×