function sfhiv_study_navigation()
{
    if (!is_singular('sfhiv_study')) {
        return;
    }
    sfhiv_draw_menu(array(get_post(get_the_ID())), array('show_children' => true, 'show_siblings' => true, 'show_parents' => true));
}
function sfhiv_page_preview_add_child_pages()
{
    $children = get_children(array('post_parent' => get_the_ID(), 'post_type' => get_post_type(get_the_ID())));
    if (count($children) < 1) {
        return;
    }
    sfhiv_draw_menu($children);
}
function sfhiv_group_page_groups_by_year()
{
    if (!is_singular('sfhiv_group')) {
        return;
    }
    $query = sfhiv_get_similar_to(get_post(get_the_ID()));
    if ($query->post_count > 0) {
        sfhiv_draw_menu($query->posts);
    }
}
function sfhiv_document_studies_sidebar()
{
    if (!is_singular('sfhiv_document')) {
        return;
    }
    $studies = sfhiv_document_get_studies();
    if ($studies->post_count < 1) {
        return;
    }
    sfhiv_draw_menu($studies->posts, array('show_parents' => true));
}
function sfhiv_event_page_parent_groups()
{
    if (!is_singular('sfhiv_event')) {
        return;
    }
    $groups = new WP_Query(array('connected_type' => 'group_events', 'connected_items' => get_the_ID()));
    if ($groups->post_count < 1) {
        return;
    }
    $group_ids = array();
    foreach ($groups->posts as $group) {
        $group_ids[] = $group->ID;
    }
    sfhiv_draw_menu($groups->posts, array('selected_items' => $group_ids));
}
function sfhiv_page_show_linked_page()
{
    if (!is_singular()) {
        return;
    }
    $page = false;
    switch (get_post_type()) {
        case 'sfhiv_group':
            if (has_term('hiv-prevention-planning-council', 'sfhiv_group_category', get_the_ID())) {
                $page = get_page_by_title('HIV Prevention Planning Council');
            }
            if (has_term('hps-units', 'sfhiv_group_category', get_the_ID())) {
                $page = get_page_by_title('Our Units');
            }
            break;
        case 'sfhiv_study':
            $page = get_page_by_title('Studies');
            break;
    }
    if (!$page) {
        return;
    }
    sfhiv_draw_menu(array($page), array("show_parents" => true));
}
function sfhiv_service_page_parent_groups()
{
    if (!is_singular('sfhiv_service')) {
        return;
    }
    $groups = sfhiv_service_get_groups(get_the_ID());
    if (count($groups) < 1) {
        return;
    }
    $group_ids = array();
    foreach ($groups as $group) {
        $group_ids[] = $group->ID;
    }
    sfhiv_draw_menu($groups, array('selected_items' => $group_ids));
}