[wp-hackers] Plugin replacing a page based on http variables

Alex Günsche ag.ml2007 at zirona.com
Thu Sep 20 14:38:15 GMT 2007


On Thu, 2007-09-20 at 10:16 -0400, Casey Bisson wrote:
> By the time the template_redirect hook is triggered, WP has already  
> queried the DB, found the page, and set the object cache. Your plugin  
> could manipulate the cache, changing the content of the page.

Partially correct. If you want to change the query, you must indeed use
the 'init' hook, as template_redirect is too late. But if you want to
change the content, i.e. the output of the template functions, you
simply need to use one or more of the filters.
http://codex.wordpress.org/Plugin_API/Filter_Reference

Alex

-- 
Alex Günsche, Zirona OpenSource-Consulting
Blogs: http://www.zirona.com/ | http://www.regularimpressions.net
PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc



More information about the wp-hackers mailing list