ri_gfdp_getFormTransientKeyForGF

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

Description

ri_gfdp_getFormTransientKeyForGF( $form, (string) $user = '' ); 

Parameters (2)

0. $form
The form.
1. $user — Optional. (string) => ''
The user.

Usage

  1. if ( !function_exists( 'ri_gfdp_getFormTransientKeyForGF' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-data-persistence-add-on-reloaded/gravity-forms-data-persistence-add-on-reloaded.php'; 
  3.  
  4. // The form. 
  5. $form = null; 
  6.  
  7. // The user. 
  8. $user = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ri_gfdp_getFormTransientKeyForGF($form, $user); 
  12.  

Defined (1)

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

/gravity-forms-data-persistence-add-on-reloaded.php  
  1. function ri_gfdp_getFormTransientKeyForGF( $form, $user = '' ) { 
  2. global $current_user; 
  3. get_currentuserinfo(); 
  4.  
  5. if(!$user) { 
  6. $user = $current_user; 
  7. if ( is_user_logged_in() ) { 
  8. $transiet_key = 'gfdp_' . $form['id'] .'_'.$user->user_login; 
  9.  
  10. return $transiet_key; 
  11. } else { 
  12. if ( isset( $_COOKIE['gfdp'] ) ) { 
  13. $transiet_key = 'gfdp_' . $form['id'] . '_' . $_COOKIE['gfdp']; 
  14.  
  15. return $transiet_key;