ri_gfdp_install

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

Description

ri_gfdp_install(); 

Usage

  1. if ( !function_exists( 'ri_gfdp_install' ) ) { 
  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_install(); 
  7.  

Defined (1)

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

/gravity-forms-data-persistence-add-on-reloaded.php  
  1. function ri_gfdp_install() { 
  2. if(!get_option('gfdp_version')) { 
  3. $users = get_users(); 
  4. $forms = RGFormsModel::get_forms(); 
  5. foreach($users as $user) { 
  6. foreach($forms as $form) { 
  7. $form = get_object_vars($form); 
  8. if($entry = get_option(ri_getFormOptionKeyForGF($form, $user->data))) { 
  9. set_transient(ri_gfdp_getFormTransientKeyForGF($form, $user->data), $entry); 
  10. delete_option(ri_getFormOptionKeyForGF($form, $user->data)); 
  11.  
  12.  
  13. update_option('gfdp_version', GFDPVERSION); 
  14. } elseif (get_option('gfdp_version') < GFDPVERSION) { 
  15.  
  16. update_option('gfdp_version', GFDPVERSION);