function field_behaviors_widget
Determines the behavior of a widget with respect to an operation.
Parameters
$op: The name of the operation. Currently supported: 'default value', 'multiple values'.
$instance: The field instance array.
Return value
One of these values:
- FIELD_BEHAVIOR_NONE: Do nothing for this operation.
- FIELD_BEHAVIOR_CUSTOM: Use the widget's callback function.
- FIELD_BEHAVIOR_DEFAULT: Use field.module default behavior.
Related topics
4 calls to field_behaviors_widget()
- FieldInfo::prepareInstance in modules/
field/ field.info.class.inc - Prepares an instance definition for the current run-time context.
- field_default_form in modules/
field/ field.form.inc - Creates a form element for a field and can populate it with a default value.
- field_default_form_errors in modules/
field/ field.form.inc - Transfer field-level validation errors to widgets.
- field_ui_field_edit_form in modules/
field_ui/ field_ui.admin.inc - Form constructor for the field instance settings form.
File
-
modules/
field/ field.info.inc, line 317
Code
function field_behaviors_widget($op, $instance) {
$info = field_info_widget_types($instance['widget']['type']);
return isset($info['behaviors'][$op]) ? $info['behaviors'][$op] : FIELD_BEHAVIOR_DEFAULT;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.