function safeword_field_property_info_callback in Safeword 7
Same name and namespace in other branches
- 8 safeword.module \safeword_field_property_info_callback()
Implements property_callbacks for hook_field_info().
1 string reference to 'safeword_field_property_info_callback'
- safeword_field_info in ./
safeword.module - Implements hook_field_info().
File
- ./
safeword.module, line 110 - Provides a FieldAPI field type, widget, and several formatters for a combined human readable/machine name pair of values. Possible uses include automatic generation of editable pathauto segments, handy Views argument values, and impressing friends.
Code
function safeword_field_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {
$property =& $info[$entity_type]['bundles'][$instance['bundle']]['properties'][$field['field_name']];
$property['getter callback'] = 'entity_metadata_field_verbatim_get';
$property['setter callback'] = 'entity_metadata_field_verbatim_set';
unset($property['query callback']);
$property['property info'] = array(
'machine' => array(
'type' => 'text',
'label' => t('Machine name'),
'setter callback' => 'entity_property_verbatim_set',
),
'human' => array(
'type' => 'text',
'label' => t('Human friendly name'),
'setter callback' => 'entity_property_verbatim_set',
),
);
}