Call external API in wordpress based on user input

s is a reserved keyword, you cannot reuse the URL parameters and query variables used by WordPress itself. This issue is unrelated to the API request code. Because your form has an input with the name s, the request is interpreted as a search request. As no posts were found in the WordPress search, you … Read more

How to add code to HTTP header

WordPress has the action send_headers, which you can use to make it send additional headers: add_action( ‘send_headers’, ‘add_header_acao’ ); function add_header_acao() { header( ‘Access-Control-Allow-Origin: *’ ); } See the documentation http://codex.wordpress.org/Plugin_API/Action_Reference/send_headers

Send a get request to wordpress

One option would be to create a Page dedicated to processing these GET requests. Something like http://example.com/create/?yourquerystringhere`. You can then create a page template, either page-create.php to automatically apply to that page, or a custom template you manually apply from the dropdown. That page template can contain your custom code: <?php // if any variables … Read more