Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter triali

    (@triali)

    Hello Sanjeev,
    Thank you for your response and suggestion.

    I appreciate your guidance regarding troubleshooting the script. I will inspect the network tab to identify any potential issues.

    Once again, thank you for your assistance and patience as we work to resolve this matter.

    Thread Starter triali

    (@triali)

    Hello Sanjeev,
    Thank you for your quick reply.

    Please see the API call below:
    add_action(‘wp_frontend_delete_account_process’, ‘custom_user_deletion_action’);
    function custom_user_deletion_action($user) {
    // Check if the user object is valid
    if ($user instanceof WP_User) {
    $user_id = $user->ID; // Extract the user ID from the user object
    $user_deletion = ‘<script>
    var ajaxurl = “https://website.com/wp-admin/admin-ajax.php&#8221;;
    var data = {
    “action”: “mo_caw_remote_call”,
    “connection_name” : “delete_user”
    };
    console.log(“API call Initiated”);
    jQuery.post(ajaxurl, data, function(response) {
    if (response) {
    console.log(response);
    }
    else {
    console.log(“API call failed”);
    }
    });
    </script>
    ‘;

    //echo $user_deletion;
    mo_caw_make_api_call_c( ‘delete_user’ );
    error_log (print_r(‘API accepted’, true));
    return true;}}

    We have tried using “wp_frontend_delete_account_process_complete” but the problem came in that the usermeta SSOID was deleted before capture as the user was deleted before string could be captured for data transfer. We have done multiple tests with “wp_frontend_delete_account_process_complete” and the result stayed the same.

    When using “wp_frontend_delete_account_process”, I successfully captured the metadata SSOID, but the user was not deleted when API call fired. When confirming password on user deletion, the ajax update remained on “Deleting…” status.

    Any further guidance or suggestions would be greatly appreciated.

    Thank you for your continued support and assistance.

Viewing 2 replies - 1 through 2 (of 2 total)