• Hello,
    I’m using ACF 5.7.7 and I have my color swatch field set to return only the value. This gives an Illegal string offset 'value' for line 394 if (in_array($value['value'], $map_to_transparent)) { I changed it to check if it was an array first and it solves the issue if (is_array($value) && in_array($value['value'], $map_to_transparent)) {

    thanks for the nice plugin

Viewing 1 replies (of 1 total)
  • Here is my solutions

    At line 399 replace:

    
    // Replace values which should be returned as transparent
    if (in_array($value['value'], $map_to_transparent)) {
        $value['value'] = 'transparent';
    }
    

    With:

    
    if (is_array($value) && array_key_exists('value', $value)
        && in_array($value['value'], $map_to_transparent)) {
        // Replace values which should be returned as transparent
        $value['value'] = 'transparent';
    } elseif (in_array($value, $map_to_transparent)) {
        $value          = [];
        $value['value'] = 'transparent';
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Error when returning only the value’ is closed to new replies.