Description
A filter to determine if a form has image choices.
Usage
add_filter( 'gform_has_image_choices', 'your_function_name', 10, 2 );
Parameters
Parameter | Type | Description |
---|---|---|
$has_image_choices | bool | Result of Gravity Forms’ automatic detection. Default true or false. |
$form | array | The current form object. |
Examples
Return Whether a Form Has Image Choice Fields.
add_filter( 'gform_has_image_choices', 'check_image_choices', 10, 2 );
function check_image_choices( $has_image_choices, $form ) {
return $has_image_choices ? true : false;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
Gravity Forms 2.8
Source Code
Located in GFFormDisplay::has_image_choices() inside form_display.php.