Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
/**
* Create an organic groups field in a bundle.
*
* @param $field_name
* The field name
* @param $entity_type
* The entity type
* @param $bundle
* The bundle name.
* @param $og_field
* Optional; Array with field definitions, to allow easier overriding by the
* caller. If empty, function will get the field info by calling
* og_fields_info() with the field name.
*/
function og_create_field($field_name, $entity_type, $bundle, $og_field = array()) {
This is a bit misleading. $field_name can't be just any old name! It has to be -- AFAICT -- a field name that og_fields_info() knows about, and therefore one defined by hook_og_fields_info().
Comments
Comment #1
shushu CreditAttribution: shushu commented