[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.


-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com]On Behalf Of Brian
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


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'

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

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

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list