Just starting to use WP for the first time as I am working on integrating a standalone app I've been working on into an existing wp site. The goal is to have the app remain functionally seperate from the site except that users of the app will be associated with a user on the wp site.
As such, I need a simple script that I can call on a link/button on the wp site which will get the current user's id, and then redirect the user to the application with a copy of the id in the request.
I'm not really having so much trouble writing this sort of script, its only a few lines, but I am having trouble understanding where in the WP file structure it should go and how to actually call it from the wp page. Is this something that requires writing an entire custom plugin? I don't really know how this all works.