gform_calculation_formula

The Gravity Forms gform calculation formula hook.

Description

apply_filters( 'gform_calculation_formula', (unknown) $field_calculationformula, (unknown) $field, (unknown) $form, (unknown) $lead ); 

Parameters (4)

0. $field_calculationformula (unknown)
The field calculationformula.
1. $field (unknown)
The field.
2. $form (unknown)
The form.
3. $lead (unknown)
The lead.

Usage

To run the hook, copy the example below.
  1. $field_calculationformula = apply_filters( 'gform_calculation_formula', $field_calculationformula, $field, $form, $lead ); 
  2.  
  3. if ( !empty( $field_calculationformula ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the gform_calculation_formula callback 
  2. function filter_gform_calculation_formula( $field_calculationformula, $field, $form, $lead ) { 
  3. // make filter magic happen here... 
  4. return $field_calculationformula
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'gform_calculation_formula', 'filter_gform_calculation_formula', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'gform_calculation_formula', 'filter_gform_calculation_formula', 10, 4 ); 

Defined (1)

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

/common.php  
  1. $formula = (string) apply_filters( 'gform_calculation_formula', $field->calculationFormula, $field, $form, $lead );