admin-ajax.php HTTP400: BAD REQUEST – The request could not be processed by the server due to invalid syntax
You can’t send the data to admin-ajax.php as JSON: data: JSON.stringify({ action: “process_coupon” }), For the wp_ajax_ actions to be fired, WordPress checks $_REQUEST[‘action’], but this is not populated by PHP when the form is submitted as JSON. The correct way to send the request with jQuery is to pass the data like this: data: … Read more