Skip to content

Instantly share code, notes, and snippets.

@benclark
Created May 28, 2013 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benclark/5665060 to your computer and use it in GitHub Desktop.
Save benclark/5665060 to your computer and use it in GitHub Desktop.
<?php
// Get all the node types that can post into groups, i.e. all types that would
// have og_access entries, and add to the content_access_settings variable.
$settings = variable_get('content_access_settings', array());
foreach (node_get_types() as $type_name => $type) {
if (!og_is_omitted_type($type_name)) {
if (!isset($settings['view'][$type_name])) {
$settings['view'][$type_name] = array(
0 => 2,
1 => 3,
);
}
if (!isset($settings['view_own'][$type_name])) {
$settings['view_own'][$type_name] = array(
0 => 2,
1 => 3,
);
}
if (!isset($settings['priority'][$type_name])) {
$settings['priority'][$type_name] = -10;
}
}
}
variable_set('content_access_settings', $settings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment