Can I somehow extend existing class method from plugin? Or can I monitor output every time method get called?
There is
class greatPlugin{
...
public function someProcess($vars){
/* The magic */
return $stringFromProcess;
}
...
}
greatPlugin
is called by hook inside WordPress before theme is loaded, but I need access (preferably) array of outputs generated by someProcess
method. For example
$greatSubOutput = array('string1', 'string2');
or just $greatSubOutput = null;
if method was not called.
The greatPlugin
class is too complex to rebuild it's great work done by original dev. If I could add just some log2array feature to that function...
You can always extend the entire class, and then extend the method like so:
class loggingGreatPlugin extends greatPlugin
{
public function someProcess($vars) {
$output = parent::someProcess($vars);
$logger = new LogMe();
$logger->log(LogLevel::INFO, $output);
return $output;
}
}