function _emfield_field_validate_id in Embedded Media Field 6.3
Same name and namespace in other branches
- 5 emfield.module \_emfield_field_validate_id()
- 6 emfield.module \_emfield_field_validate_id()
- 6.2 emfield.module \_emfield_field_validate_id()
Extract the id from embedded code or url.
2 calls to _emfield_field_validate_id()
- _emfield_emfield_field in ./
emfield.cck.inc - Implementation of hook_emfield_field(). This in turn is a callback for hook_field().
- _emfield_emfield_field in deprecated/
emfield-deprecated.cck.inc - Implementation of hook_emfield_field(). This in turn is a callback for hook_field().
File
- deprecated/
emfield-deprecated.inc, line 197 - Functionality to be deprecated from earlier versions of Embedded Media Field.
Code
function _emfield_field_validate_id($field, $item, $error_field, $module, $delta = 0) {
// Load the provider info.
$item = _emfield_field_submit_id($field, $item, $module, $error_field);
// Ensure we have proper provider info.
if ($item['embed'] && !$item['provider']) {
form_set_error($error_field, t('You have specified an invalid media URL or embed code.'));
}
else {
emfield_include_invoke($module, $item['provider'], 'validate', $item['value'], $error_field);
}
return $item;
}