ri_gfdp_ajax

The Gravity Forms Data Persistence Add-On Reloaded ri gfdp ajax function.

Description

ri_gfdp_ajax(); 

Usage

  1. if ( !function_exists( 'ri_gfdp_ajax' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-data-persistence-add-on-reloaded/gravity-forms-data-persistence-add-on-reloaded.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ri_gfdp_ajax(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/gravity-forms-data-persistence-add-on-reloaded.php  
  1. function ri_gfdp_ajax() { 
  2. global $wpdb; // this is how you get access to the database 
  3. parse_str( $_POST['form'], $data ); 
  4. $form_id = isset( $data['gform_submit'] ) ? $data["gform_submit"] : 0; 
  5. if ( $form_id ) { 
  6. $form_info = RGFormsModel::get_form( $form_id ); 
  7. $is_valid_form = $form_info && $form_info->is_active; 
  8. if ( $is_valid_form ) { 
  9. $form = GFFormsModel::get_form_meta( $form_id ); 
  10. $form = GFFormsModel::add_default_properties( $form ); 
  11. ri_gfdp_ajax_save( $form ); 
  12. echo "Saved"; 
  13. } else { 
  14. echo "Invalid Form"; 
  15. } else { 
  16. echo "Invalid Form"; 
  17.  
  18. die(); // this is required to terminate immediately and return a proper response