ri_gfdp_sanitize_data

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

Description

ri_gfdp_sanitize_data( $data, $form ); 

Parameters (2)

0. $data
The data.
1. $form
The form.

Usage

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

Defined (1)

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

/gravity-forms-data-persistence-add-on-reloaded.php  
  1. function ri_gfdp_sanitize_data( $data, $form ) { 
  2. foreach ( $form['fields'] as $field ) { 
  3. if ( $field['ri_gfdp_no_persist'] ) { 
  4. if ( is_array( $field['inputs'] ) ) { 
  5. foreach ( $field['inputs'] as $input ) { 
  6. $data[ 'input_' . str_replace( '.', '_', $input['id'] ) ] = ''; 
  7. } else { 
  8. $data[ 'input_' . $field['id'] ] = ''; 
  9.  
  10.  
  11. return $data;