I have a list in Gravity forms created with 3 columns, but need the first column to be text, the second to be a drop-down with 3 options and also the third column to be a drop-down with 3 options. I can get the second column to be a drop-down, but fail to get the third.
Using this post: GravityForms - List Field with DropDown on entries column - I can get the following code to work:
add_filter( 'gform_column_input_1_27_2', 'set_column', 10, 5 );
function set_column( $input_info, $field, $column, $value, $form_id ) {
return array( 'type' => 'select', 'choices' => 'Fluent,Adequate,Basic' );
}
But if I add the code again and set the ID to gform_column_input_1_27_3 to get the following:
add_filter( 'gform_column_input_1_27_2', 'set_column', 10, 5 );
function set_column( $input_info, $field, $column, $value, $form_id ) {
return array( 'type' => 'select', 'choices' => 'Fluent,Adequate,Basic' );
}
add_filter( 'gform_column_input_1_27_3', 'set_column', 10, 5 );
function set_column( $input_info, $field, $column, $value, $form_id ) {
return array( 'type' => 'select', 'choices' => 'Fluent,Adequate,Basic' );
}
It returns an error:
Cannot redeclare set_column() (previously declared in wp-content/themes/xxxxxx/functions.php:40)
Can someone explain how do I get the third column to display a dropdown like the second does? Thanks.