A javascript function that simply runs a php function on the plugin

In your JS code, you need an action so it knows what function to execute. var data = { ‘action’: ‘my_action’, ‘nothing’: ‘nothing’ ‘whatever’: ajax_object.we_walue } You should see how the action corresponds to the hook you used in add_action. But I would also add a second action: add_action(‘wp_ajax_my_action’, ‘back_php’); add_action(‘wp_ajax_no_priv_my_action’, ‘back_php’); This will ensure … Read more

Find the method which AJAX GET calls

If the url is something like this admin-ajax.php?example_ajax_request=1&data=1234 The add_action function in the code would be wp_ajax_nopriv_example_ajax_request So, try to grep the whole of your theme directory or plugin directory for the text. Example: grep -r ‘wp_ajax_nopriv_example_ajax_request’ * The second parameter of the add_action is the function name you’re looking for. See https://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side for example … Read more