/**
 * Output the Add Friend button.
 *
 * @see bp_get_add_friend_button() for information on arguments.
 *
 * @param int      $potential_friend_id See {@link bp_get_add_friend_button()}.
 * @param int|bool $friend_status       See {@link bp_get_add_friend_button()}.
 */
function bp_add_friend_button($potential_friend_id = 0, $friend_status = false)
{
    echo bp_get_add_friend_button($potential_friend_id, $friend_status);
}
function bp_legacy_theme_ajax_my_get_friendship_status()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    error_log("og get friendship status " . groups_get_id("students"));
    $myretval = array();
    // Cast gid as integer
    $my_friend_ids = $_POST['fids'];
    error_log("og friend status:" . print_r($my_group_ids, true));
    for ($myidx = 0; $myidx < count($my_friend_ids); $myidx++) {
        $my_friend_id = (int) $my_friend_ids[$myidx];
        error_log("og friend id:" . $my_friend_id . " ");
        $bp_loggedin_user_id = bp_loggedin_user_id();
        $my_is_friend = 'is_friend' == BP_Friends_Friendship::check_is_friend($bp_loggedin_user_id, $my_friend_id);
        $htmlstrtoreturn = bp_get_add_friend_button($my_friend_id, $my_is_friend);
        $myretval[$my_friend_ids[$myidx]] = $htmlstrtoreturn;
    }
    echo json_encode($myretval);
    exit;
}