I just ran into an annoying problem on one of my WP sites. I'm using the qtranslate plugin and in the functions.php of my theme, I access some of that plugin's functions.
Now, it seems that functions.php of the activated theme is included in the WP backend (for some reason). This means that when I deactivate the plugin, the functions from that plugin which are used in functions.php causes not only the frontend, but also the backend to break
Fatal error: undefined function the_function.
This causes a tricky situation, as you cannot reactivate the plugin in the broken backend. My first thought was to manually define the functions I access and upload the functions.php via FTP. That works, but then you cannot activate the plugin because some of it's functions are already defined.
The only way to solve this (that I found), is to rename your functions.php, reactivate the plugin, then rename functions.php back.
Things brings me to my question (sorry for the long intro): what's the designated way to access plugin functions in a custom theme? Using a function_exists('the_function') everywhere isn't very handy. Does WP provide some sort of wrapper for this? Or am I looking at this entirely the wrong way?
if(function_exists( 'function_name' )) :.call_plugin('function_name', array('array', 'of', 'arguments')). Maybe I'll write something of the sort next time I need it.is_plugin_active