| 7 field.api.php | hook_field_create_instance($instance) |
| 8 field.api.php | hook_field_create_instance($instance) |
Act on a field instance being created.
This hook is invoked from field_create_instance() after the instance record is saved, so it cannot be used to modify the instance itself.
Parameters
$instance: The instance just created.
Related topics
1 invocation of hook_field_create_instance()
File
- modules/
field/ field.api.php, line 2424
Code
function hook_field_create_instance($instance) {
// @todo Needs function body.
}
Login or register to post comments
Comments
Happens on field creation, before settings are set
This happens when the field instance is first created (e.g. after the manage fields page, before loading the first field settings page). This is before the instance settings form, so instance settings won't yet be defined.
To act after instance settings are defined, one option is hook_field_update_instance(). This is also called after the first create step, and also after saving settings, so if field instance settings are required, they need to be tested for.