Ajax request sends url rather than data
Some Notes You shouldn’t use anonymous/lambda fn, closures for hooks – Those can’t get unregistered. Create your nonces, when localizing the script – See for ex. this answer. The ajaxurl isn’t set by default. You’ll have to define it (and let it point to admin-ajax.php) when localizing the script. Then you access it via the … Read more