AJAX call returns 0

Note that the action should be inside the data key. In your post request there is no key named as action therefore, the callback function is never being called.

Consider this example:-

jQuery.ajax({
    type:"POST",
    url: "/wp-admin/admin-ajax.php",
    data: { 
        action: "my_test_action",
        form_data : newFormChange
    },
    success: function (data) {
        console.log(data);
    }
});

Also Note: Never use relative Ajax URL like /wp-admin/admin-ajax.php. You can use wp_localize_script(). See these examples

Leave a Comment