Don't let the jerk above talk to you about being rude. I have a Wordpress website that needed "content pages" built on the fly as a user click a link within an existing page. Your code worked like a charm.
Usage: I put your Class and Args code in my theme's functions. php. The Args code went inside a separate function like this:
makevirtual() {
$args = array( 'slug' => 'fakeslug', 'posttitle' => 'Fake Page Title', 'post content' => 'This is the fake page content' );
new WPEXPAGEONTHEFLY($args);
}
Changed the fake_slug parameter to a slug name that matched up with a existing content page and away it went.
I use a little javascript code to call the function: onclick="<?php make_virtual(); ?>.
What is also beautiful about this is that inside the make_virtual($parameter1, $parameter2) function I can pass whatever variables I need to. LOL
EXCEPT one thing.. these aren't FAKE pages for me.. they are REAL and useful and added to my database for viewing by all.
Hey bainternet --- this code is AWESOME!
Don't let the jerk above talk to you about being rude. I have a Wordpress website that needed "content pages" built on the fly as a user click a link within an existing page. Your code worked like a charm.
Usage: I put your Class and Args code in my theme's functions. php. The Args code went inside a separate function like this:
makevirtual() {
$args = array( 'slug' => 'fakeslug', 'posttitle' => 'Fake Page Title', 'post content' => 'This is the fake page content' );
new WPEXPAGEONTHEFLY($args);
}
Changed the fake_slug parameter to a slug name that matched up with a existing content page and away it went.
I use a little javascript code to call the function: onclick="<?php make_virtual(); ?>.
What is also beautiful about this is that inside the make_virtual($parameter1, $parameter2) function I can pass whatever variables I need to. LOL
EXCEPT one thing.. these aren't FAKE pages for me.. they are REAL and useful and added to my database for viewing by all.
Cheers,
Bob Campbell
newscruzin.com