function cvm_field_install in Contextual View Modes 7
Implements hook_install().
File
- modules/
cvm_field/ cvm_field.install, line 10
Code
function cvm_field_install() {
// Need to tell drupal about my new field first :(.
field_cache_clear();
field_associate_fields('cvm_field');
// Check if our field is not already created.
if (!field_info_field(CVM_FIELD_NAME)) {
$field = array(
'field_name' => CVM_FIELD_NAME,
'type' => 'cvm_field_cvm',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
);
$the_field = field_create_field($field);
}
}