400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true

You can upload file using ajax using below code: First : Add attributes name=”f-form” and id=”f-form” in your <form> tag. After that, In js script, get form data using new FormData() and send to ajax data, Note : change url: ajax_object.ajaxurl with your ajax url path jQuery(document).ready(function(e) { jQuery(‘#f-submit’).on(‘click’, function(e) { e.preventDefault(); var form = … Read more

Adding Amchart Interface to WordPress API

I was able to find a solution here. Add this to $args in setup.php ‘show_in_rest’ => true, ‘rest_base’ => ‘charts’ Add this to the bottom of the setup.php file. fistly, you’re registering the fields to get/set in the rest interface. then you’re registering the specific meta data to the post_type = amchart add_action(“rest_api_init”, function () … Read more