I am just getting reaquainted with writing plugins, after writing a whole two about three years ago. Following some example code I found:
if(!class_exists('QuizMaster_Plugin_Template')) {
class QuizMaster_Plugin_Template
{
public function __construct()
{
// register actions.
}
public static function activate()
{
// Do nothing
}
public static function deactivate()
{
// Do nothing
}
}
}
if(class_exists('QuizMaster_Plugin_Template')) {
register_activation_hook(__FILE__, array('QuizMaster_Plugin_Template', 'activate'));
register_deactivation_hook(__FILE__, array('QuizMaster_Plugin_Template', 'deactivate'));
$ewp_quiz_master = new QuizMaster_Plugin_Template();
}
When I run this code in PhpStorm, I get the following error rendered to the client:
Fatal error: Call to undefined function register_activation_hook() in C:\WordPress\Plugins\ewp-quiz-master\ewp-quiz-master.php on line 33
I'm kind of guessing I have to set up some include files for PhpStorm, or even just for the plugin, just for the dev phase, but I have no idea where to start, and Google hasn't seemed very helpful on this.