How can I make a button on the Page call a post api method?

[ad_1]

I created a post method in a simple plug-in and I’m trying to use it in the frontend. The problem is, the default button in WordPress just redirects to the url instead of calling a request on it, how can I make it so the buttons makes a post request instead of a redirection one?

[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