| Versionen | |
|---|---|
| drupal7 | field_read_instance($field_name, $bundle, $include_additional = array()) |
Read a single instance record directly from the database. Generally, you should use the field_info_instance() instead.
$field_name The field name to read.
$bundle The bundle to which the field is bound.
array $include_additional The default behavior of this function is to not return an instance that is inactive or has been deleted. Setting $include_additional['include_inactive'] or $include_additional['include_deleted'] to TRUE will override this behavior.
An instance structure, or FALSE.
modules/
<?php
function field_read_instance($field_name, $bundle, $include_additional = array()) {
$instances = field_read_instances(array('field_name' => $field_name, 'bundle' => $bundle), $include_additional);
return $instances ? current($instances) : FALSE;
}
?>
Kommentare
Kommentar hinzufügen