Custom Drupal field widget causing check_plain() error
According to the hook description, $items is an "Array of default values for this field."  You are trying to look in an array of arrays in your default value.

You need to change this line:

    '#default_value' =&gt; isset($items[$delta]['value']) ? $items[$delta]['value'] : '',


to look in the $items array, rather than the $items[$delta] array (which doesn't exist) by removing ['value'], like this:

    '#default_value' =&gt; isset($items[$delta]) ? $items[$delta] : '',