Nom no! The add_action is in plugin.php, just like in the example above.
In my original example I was using end_loop as the hook, but simplified it because that was the hook you cited as an example.
What’s in the template is a call to the function:
$result = hereman1() ;
That function is undefined. If I prepend PluginName:: it works.
Maybe it’s me. I’ve taken both of your examples and pared down (deleted all the boilerplate code) to the point that my plugin.php is in the case of your second example these few lines:
<?php
class PHZplug {
static public function hereman1() {
return 'Yup, I am Here' ;
}
}
add_action( 'init', array( 'PHZplug', 'hereman1' ) );
?>
I’m still unable to make a call to hereman1() in my template. I know the plugin is being loaded because the error goes away if I edit the template to read PHZplug::hereman1().
Shouldn’t the add action call make it so I can call the function directly?