How can I write a plugin that only intents to provide the class to be called by other plugins. for example, if I have a class like this:
class Test{
public static function testMethod(){}
}
then within wordpress envrionement, we will be able to call Test::testMethod();
Does the following works?
<?php
/*
Plugin Name: My Plugin
...other WP plugin headers
*/
add_action('init', 'test_init', 0);
function test_init(){
$test=new Test();
}
class Test{
public static function testMethod(){}
}
?>
I don't think this is a right way to do it. any input is appreciated.