function og_subgroups_group_is_child in Subgroups for Organic groups 6
Determine if a group is the child of a given parent group
This function will iterate though the entire parents lower ancestry, returning TRUE even if the child is multiple levels below (child of a child)
Parameters
$parent: The parent group node
$child: The child group node
Return value
TRUE if $child is a child of $parent, or a child of a child of the $parent, and so on, otherwise FALSE.
2 calls to og_subgroups_group_is_child()
- og_subgroups_context_condition_node_below_og::execute in modules/
og_subgroups_context/ plugins/ og_subgroups_context_condition_node_below_og.inc - Execute the plugin
- og_subgroups_node_form_validate in ./
og_subgroups.module - Validate the group node form
File
- includes/
tree.inc, line 262 - Functions to generate and use the group hierarchy trees
Code
function og_subgroups_group_is_child($parent, $child) {
return in_array($child->nid, array_keys(og_subgroups_get_group_children($parent, FALSE)));
}