function field_test_field_info in Drupal 7
Implements hook_field_info().
2 calls to field_test_field_info()
- FieldInfoTestCase::testFieldInfo in modules/
field/ tests/ field.test - Test that field types and field definitions are correcly cached.
- FieldInfoTestCase::testSettingsInfo in modules/
field/ tests/ field.test - Test that the field_info settings convenience functions work.
File
- modules/
field/ tests/ field_test.field.inc, line 11 - Defines a field type and its formatters and widgets.
Code
function field_test_field_info() {
return array(
'test_field' => array(
'label' => t('Test field'),
'description' => t('Dummy field type used for tests.'),
'settings' => array(
'test_field_setting' => 'dummy test string',
'changeable' => 'a changeable field setting',
'unchangeable' => 'an unchangeable field setting',
),
'instance_settings' => array(
'test_instance_setting' => 'dummy test string',
'test_hook_field_load' => FALSE,
),
'default_widget' => 'test_field_widget',
'default_formatter' => 'field_test_default',
),
'shape' => array(
'label' => t('Shape'),
'description' => t('Another dummy field type.'),
'settings' => array(
'foreign_key_name' => 'shape',
),
'instance_settings' => array(),
'default_widget' => 'test_field_widget',
'default_formatter' => 'field_test_default',
),
'hidden_test_field' => array(
'no_ui' => TRUE,
'label' => t('Hidden from UI test field'),
'description' => t('Dummy hidden field type used for tests.'),
'settings' => array(),
'instance_settings' => array(),
'default_widget' => 'test_field_widget',
'default_formatter' => 'field_test_default',
),
);
}