[wp-hackers] Fooling Wordpress To Think Plugin Output Is A Page

Andy Skelton skeltoac at gmail.com
Sun Jan 24 17:04:21 UTC 2010


On Sat, Jan 23, 2010 at 7:42 PM, Alex Andrews <awgandrews at gmail.com> wrote:
> In my plugin I interrupt template_redirect to produce my own pages via
> loading my own templates. However, to trick certain bits of the
> template into working, it would be very useful for Wordpress to think
> these are pages proper, with titles etc. Is there some internal
> Wordpress variable or set of variables I can set to do this? It would
> be especially good if I could trick the plugin generated page to think
> it was a part of the normal hierarchy of Wordpress pages, ie could
> possibly have parents etc, while not being an part of this formally.

You could ferret out all of the related filters and add your virtual
page that way. Why not just add the page to the database?

Andy


More information about the wp-hackers mailing list