[wp-hackers] add_rewrite_endpoint...?

Angsuman Chakraborty angsuman at taragana.com
Wed Jun 14 06:19:47 GMT 2006


Are there any examples of using add_rewrite_endpoint anywhere. I couldn't find its usage in obvious endpoints like trackbacks etc.
Can anyone please provide me with a simple example or point me to one.

Thanks,
Angsuman

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com]On Behalf Of Brian
Layman
Sent: Wednesday, June 14, 2006 12:37 AM
To: wp-hackers at lists.automattic.com
Subject: RE: [wp-hackers] Custom Permalinks - how to?
Importance: Low


Ha! This is the same subject my last email!
Use template_redirect

See here: http://codex.wordpress.org/Plugin_API

template_redirect

No parameter. Executes before the determination of the template file to be
used to display the requested page. Useful for providing additional
templates based on request criteria. Example (pedagogical, not useful):
Redirect all requests to the all.php template file in the current themes'
directory. 

function all_on_one () {
	include(TEMPLATEPATH . '/all.php');
	exit;
}

add_action('template_redirect', 'all_on_one');



What you are doing is almost exactly what this is designed for.  Take a look
in template-loader.php for more examples...

_______________________________________________
Brian Layman
www.TheCodeCave.com

_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list