Calling a method from functions.php on a click of a button
You could use AJAX if you don’t want to reload the current page — i.e. upon clicking the “Accept” button, make an AJAX request to update the user metadata, all without leaving the current page. However, the solution I’m proposing is not using AJAX; instead, we simply submit the form (set its action attribute value) … Read more