Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
308 views
in Plugins by
How can i create a global function that will be available in the whole Q2A app, I want that my global function to be defined in my plugin.
Q2A version: 1.7.4

1 Answer

+1 vote
by

If you want to use it in a plugin, the easiest method is to include the file (using require_once) from your qa-plugin.php file.

If you don't have a specific plugin to put it in, you could cheat and make your own. Add a directory in qa-plugins/ then add your metadata.json file with some basic valid info, plus a qa-plugin.php that has your function in it (or uses require_once to include an external file with the function).

...