
I am using my own flexible content field and I filter it from another select field that is registered to an option page. The is basically a Global Blocks page. The fields are working great within the Admin panel and with in the front end of my website, but because of this I am getting this PHP Warning.
Illegal string offset 'acf_fc_layout' in /var/www/shopbedmart/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 833
Looking at the file and code there is a condition after the variable to check if it exists and if not then continue:
class-acf-field-flexible-content.php on line 833
// get layout name
$l = $value[ $i ]['acf_fc_layout'];
// bail early if layout deosnt exist
if( empty($layouts[ $l ]) ) continue;
In order to get rid of the Warnings which are flooding my log file I think an additional condition should be placed before the $l variable.
Like
if (empty($value[ $i ]['acf_fc_layout'])) continue;
// get layout name
$l = $value[ $i ]['acf_fc_layout'];
// bail early if layout deosnt exist
if( empty($layouts[ $l ]) ) continue;
Thanks
Hi, have you found out what is causing this issue?