Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • oguruma
    Participant

    @oguruma

    Thanks for the input. I was hoping to catch extended profile meta at time of registration, but it turns out that the insert_user_meta filter fires too soon…

    Do you know of a good way to capture extended profile meta at user registration? (assuming they entered it at registration, of course).

    `add_filter(‘insert_user_meta’,’send_user_data’,100,4);

    function send_user_data($meta,$user,$update,$userdata){
    $user_id = $userdata[‘ID’];
    $phone_number = strip_tags( xprofile_get_field_data ($user_id, ’11’,’string’) );

    $ch = curl_init();

    $user_payload = array (
    ‘id’ => $user_id,
    ‘phone’ => $phone_number,
    );

    curl_setopt($ch, CURLOPT_URL,”https://myurl.m.pipedream.net”);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $user_payload);

    // In real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    // http_build_query(array(‘postvar1’ => ‘value1’)));

    // Receive server response …
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec($ch);

    curl_close ($ch);

    return $meta;
    return $user;
    return $update;
    return $userdata;

    };

Viewing 1 replies (of 1 total)
Skip to toolbar