public function presave($value, $current_value = array())
{
// It's possible that some elements (Grid is one) would be arrays at
// this point, but those elements must override this function. Let's
// make sure we're dealing with one value here.
if (is_array($value)) {
$this->_unauthorized_access(__('presave() in the base class should not get arrays, but did.', 'fieldmanager'));
}
foreach ($this->validate as $func) {
if (!call_user_func($func, $value)) {
$this->_failed_validation(sprintf(__('Input "%1$s" is not valid for field "%2$s" ', 'fieldmanager'), (string) $value, $this->label));
}
}
return call_user_func($this->sanitize, $value);
}