I have created a basic custom theme for my blog and I have made a form to report issues. Should I send an API call to admin-ajax.php or a custom REST API endpoint?

[ad_1]

Hi

I’ve hand coded a theme for my blog. I have a form where the user can report an issue. The form sends the data asynchronously to the backend. I have seen that it’s possible to send it to `/wp-admin/admin-ajax.php` and also possible to create a custom REST API endpoint and send there as a POST method. Is there any advantage and/or disadvantage to each?

Thanks

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer