I am using the following Plugin to let users post their content with Gravity Forms: https://wordpress.org/support/plugin/gravity-forms-custom-post-types
When I using a textfield and want to save taxonomies in it, I get the following error (frontend and backend):
Fatal error: Cannot use string offset as an array in ..../gravity-forms-custom-post-types/gfcptaddonbase.php on line 301
Any idea why?
This is the function which causes the problem:
function setup_taxonomy_field( &$field, $taxonomy ) {
$first_choice = $field['choices'][0]['text'];
$field['choices'] = $this->load_taxonomy_choices( $taxonomy, $field['type'], $first_choice );
//now check if we are dealing with a checkbox list and do some extra magic
if ( $field['type'] == 'checkbox' ) {
//clear the inputs first
$field['inputs'] = array();
$counter = 0;
//recreate the inputs so they are captured correctly on form submission
foreach( $field['choices'] as $choice ) {
$counter++;
if ( ($counter % 10) == 0 ) $counter++; //thanks to Peter Schuster for the help on this fix
$id = floatval( $field['id'] . '.' . $counter );
$field['inputs'][] = array('label' => $choice['text'], 'id' => $id);
}
}
}
If I comment out the first line of the function, it causes no error anymore, and the tags are submitted anyway. But do I need this line?