Quote:
Originally Posted by nerbert
That code is a straight copy/paste out of the file itself with the fetch_template_complete hook commented out (Idon't think you can have a hook in a plugin). Now the plugin code finishes the function (method, for you purists) and everything should run.
|
I don't think that quite works as expected because calling return in a plugin doesn't return from the function that calls it, it provides a return value from the 'eval' call (which is ignored). But as you can see in the code above, there's a "fetched" variable, and if the plugin sets that to true then the database query (or cache lookup) won't be done. So I think you'd want your plugin to include only the code from inside the "if", then set $fetched to true.
Edit: I think tpearl's code would work because the code in fetch_template() gets it from the cache if it's set.