How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)

I have to build a WordPress plugin which gives out HTML for an AJAX call. However, because of the server environment I cannot use the traditional admin-ajax.php.

Someone told me that I could build a custom page using url-rewrite ex: /my-ajax-calls/

Read More

So when I send a request to that page it would be:

jQuery.get("/my-ajax-calls/param1/param2/",...);

Then I could use param1 & param2 and give the appropriate HTML.

I know how to build plugins, how do I rewrite the URL to connect it with a method that generates the HTML?

Related posts

Leave a Reply

1 comment