gform_event_category

Filter: gform_event_category.

Description

apply_filters( 'gform_event_category', (string) $ga_event_data_gaeventcategory, (object) $form, (object) $entry ); 

Filter the event category dynamically

Parameters (3)

0. $ga_event_data_gaeventcategory (string)
The ga event data gaeventcategory.
1. $form (object)
Gravity Form form object
2. $entry (object)
Gravity Form Entry Object

Usage

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

Defined (1)

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

/includes/class-gravity-forms-event-tracking-feed.php  
  1. $event->setEventCategory( apply_filters( 'gform_event_category', $ga_event_data['gaEventCategory'], $form, $entry ) );