[wp-hackers] Displaying a page on-the-fly with a plugin

Mike Little wordpress at zed1.com
Wed Oct 27 09:01:03 UTC 2010


On 27 October 2010 03:00, Dino Termini <dino at duechiacchiere.it> wrote:

> On 10/26/2010 9:56 PM, Anthony Cole wrote:
>
>> I would use a shortcode, and you could filter out the_content and replace
>> it with do_shortcode('shortcode')  or a function, checking the Post ID
>> through the post global.
>>
>> Would be interested to see if anyone else has a suggestion.
>>
>> -ac
>>
>
> Right, but the point is to totally avoid creating this page at all :-)
>
>
>

Here is what I did on a multi-site project project that required a number of
predefined pages.
It basically creates the page on the fly, but only if it doesn't already
exist.

http://wordpress.pastebin.com/LFGiBC8h

You can add a shortcode as the sole content of the fake page so that it is
handled by normal processing, for example.


Mike
-- 
Mike Little
http://zed1.com/


More information about the wp-hackers mailing list