Error using gallery in ACF
-
I created a field group in Advanced Custom Fields with a FileBird Folder field (using the free versions of FileBird and ACF, if that matters). The field group is used in a custom post type, registered so it’s available through the admin menu. When I create a new custom post of that type, or when I edit an existing post with no folder selected, each option in the folder selection is preceded by an error message:
“Warning: in_array() expects parameter 2 to be array, string given in /home4/iaqqtemy/public_html/sitename/wp-content/plugins/filebird/includes/Classes/ACF/acf-field-filebird-v5.php on line 37”.
Line 37 in that file is:
$selected = $field[‘value’] === null ? null : in_array( $folder[‘id’], $field[‘value’] );
So it seems like field[‘value’] is an empty string, rather than an array. I changed it to:
$selected = $field[‘value’] ? in_array( $folder[‘id’], $field[‘value’] ) : null;
and that seems to work. Do you see a problem with that? Either way, perhaps you can work a fix into the next version? Thanks.
- The topic ‘Error using gallery in ACF’ is closed to new replies.