Description
Allows the form object to be manipulated before the poll results are calculated for the front-end and entry detail pages.
Usage
The following would apply to all forms:
add_filter( 'gform_polls_form_pre_results', 'your_function_name', 10, 1 );
To target a specific form, append the form id to the hook name. (format: gform_polls_form_pre_results_FORMID)
add_filter( 'gform_polls_form_pre_results_2', 'your_function_name', 10, 1 );
Parameters
- $form Form Object
The form.
Examples
add_filter( 'gform_polls_form_pre_results', 'change_poll_form', 10, 1 ); function change_poll_form( $form ){ $form['title'] = 'Testing'; //change some data return $form; }
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in the Gravity Forms Polls Add-On version 1.4.
Source Code
This filter is located in GFPolls::gpoll_get_data() in gravityformspolls/class-gf-polls.php