#The Problem
I need to create custom links based on the current page URL within WordPress. The system needs to work with both pretty and default permalinks. I have a custom rewrite endpoint defined that needs to be added.
So if the URL of the page is http://site.url/?p=25
I need to create http://site.url/?p=25&custom=1
If the URL is http://site.url/2012/post-slug
I need to create http://site.url/2012/post-slug/custom
I can't find a built-in function to do this, so I'm thinking I'll need to build my own to do this. Some pseudo-code: