i have a case in my admin panel where i need to call my own function that resides in my own php file, with a GET request. This function is actually removing entries from the database.
So, i would like to make sure that this cannot be invoked from anybody else than the admin user. What is the best way of doing that ? Notice that my 'example.php?filename=..' script is executed directly and should return with refreshing the page on the admin panel.
How do i secure that properly ? Is there a better way of doing that while being controlled by Wordpress default security measures ?
It would be also great to be able to execute things like get_option in the context of my php code.