You are here

function og_example_enable in Organic groups 7.2

Implements hook_enable().

Add group audience fields to "Post" node type.

File

og_example/og_example.install, line 13
Install, update, and uninstall functions for the OG example module.

Code

function og_example_enable() {
  $og_field = og_fields_info(OG_AUDIENCE_FIELD);
  $og_field['field']['settings']['target_type'] = 'node';

  // Enable Entity reference prepopulate.
  $og_field['instance']['settings']['behaviors']['prepopulate'] = array(
    'status' => TRUE,
    'action' => 'none',
    'fallback' => 'none',
    'skip_perm' => FALSE,
  );
  og_create_field(OG_AUDIENCE_FIELD, 'node', 'post', $og_field);
}