Created
May 28, 2013 18:40
-
-
Save benclark/5665060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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