I am receiving this error "Warning: Illegal string offset 'type' in /home/mysite/public_html/wp-content/themes/evento/lib/php/extra.class.php on line 32"
and I realized this section of code in the file is wrong, however I'm not that great in PHP yet and I am wondering if someone can help me re-write this section to eliminate the error. Thanks! (the error starts on line 32 which is the beginning of the if statement below)
Here is the code:
/* new version */
function get_attachment_struct( $inputs ){
$attach = array();
if( $inputs['type'] == 'attach' ){
$name = $inputs['name'];
$attach = array(
0 => array(
'name' => $name,
'type' => 'text',
'label' => 'Attachment URL',
'lvisible' => false,
'upload' => true,
),
1 => array(
'name' => $name .'_id',
'type' => 'hidden',
'upload' => true
),
);
if( isset( $inputs[ 'classes' ] ) ){
$attach[0]['classes'] = $inputs[ 'classes' ];
$attach[1]['classes'] = $inputs[ 'classes' ] . '_id';
}
}
return $attach;
}
/* new version */