function bf_profile_tabs_content($bf_um_form_slug)
{
    global $buddyforms, $bf_um_tabs, $bf_um_form_slug;
    $form_slug = $bf_um_tabs[$bf_um_form_slug];
    // Get the correct tab slug
    $parent_tab = bf_ultimate_member_parent_tab($buddyforms[$form_slug]);
    // Check if the ultimate member view is a form view and add the coret content
    if (isset($_GET['profiletab']) && $_GET['profiletab'] == $parent_tab) {
        if (!isset($_GET['subnav']) || $_GET['subnav'] == 'posts-' . $bf_um_form_slug) {
            // Display the posts
            echo do_shortcode('[buddyforms_the_loop form_slug="' . $form_slug . '" author="' . um_profile_id() . '"]');
        } else {
            // Create the arguments aray for the form to get displayed
            $args = array('form_slug' => $form_slug);
            // Add the post id if post edit
            if (isset($_GET['bf_post_id'])) {
                $args['post_id'] = $_GET['bf_post_id'];
            }
            // Add the revisionsid if needed
            if (isset($_GET['bf_rev_id'])) {
                $args['revision_id'] = $_GET['bf_rev_id'];
            }
            buddyforms_create_edit_form($args);
        }
    }
}
function bf_ultimate_member_page_link_router_edit($link, $id)
{
    global $buddyforms, $current_user;
    $form_slug = get_post_meta($id, '_bf_form_slug', true);
    $um_options = get_option('um_options');
    if (isset($form_slug)) {
        return $link;
    }
    if (isset($buddyforms[$form_slug]['ultimate_members_profiles_integration'])) {
        return $link;
    }
    $parent_tab = bf_ultimate_member_parent_tab($buddyforms[$form_slug]);
    $current_user = wp_get_current_user();
    $userdata = get_userdata($current_user->ID);
    $link_href = get_the_permalink($um_options['core_user']) . $userdata->user_nicename . '?profiletab=' . $parent_tab . '&subnav=form-' . $form_slug . '&bf_post_id=' . $id;
    return '<a title="Edit" id="' . $id . '" class="bf_edit_post" href="' . $link_href . '">' . __('Edit', 'buddyforms') . '</a>';
}