WordPress action – Pass arguments into action in an AJAX call?
You can’t pass arguments to wp_ajax_ callbacks. You need to pass the data via the data property of the AJAX request. Then you get those values with $_POST and pass them to a function: function newsletterSignupAjax() { $id = $_POST[‘id’]; $source = $_POST[‘source’]; /* Make sure to validate and sanitize those values. */ newsletterSignup( $id, … Read more