I was planning to use a distinct php file under /my-theme/ajax/my-ajax-file.php.
But AJAX in Plugins in Codex suggests to define AJAX calls with an add_action as follows:
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.