I am creating a plugin which has just one setting which is set with add_option('myinfo')
in my main plugin php file. However, I have a second php file which is almost freestanding, except that I want it to get that setting. I tried using get_option('myinfo')
, which works in the first file, but in the second file, it gives this error:
Fatal error: Call to undefined function get_option()
Basically, I think that my second php file is totally outside of WordPress. No WordPress specific code works, it just acts like some regular php file. How can I get the php file to have access to the WordPress database?
The file is mostly standalone, all it does is respond to an Ajax request, but I just want it to have this one piece of data from my plugin.