Answer the question
In order to leave comments, you need to log in
How to respond to an external request in wordpress?
It is necessary to implement a response from wordpress to a request from another site. At first I just put a file in the root with vp and tried to make a request, everything worked out, but as soon as I connect this file to vp using
require($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');
then the answer is no more. add_action( 'wp_ajax_myactionname, 'myaction_ajax');
add_action( 'wp_ajax_nopriv_myactionname', 'myaction_ajax');
function myaction_ajax(){
print "OK";
}
, on another site, the call goes to mysite.ru/wp-admin/admin-ajax.php?action=myactionname, but nothing happens. Tell me how to process the request and respond to it from WP.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question