Plugin contents with rewrite
-
I’ve googled quite a lot about this but I’ve yet to find what I’m looking for.
I’m trying my hands at creating a plugin. This should work so that users put a shorttag on the page they want it on, and the shorttag is replaced with custom content. So far I’ve been able to do this and replace the shorttag with a PHP file.
However, I have seen other plugins do this, but I don’t know how:
I would like all subsequent page requests to go to the same page, where the included PHP file handles which content is being displayed.
Say I add a page with the URL /mypage
On this page I add the shorttag [mytag].
This tag is replaced with a list of links.
One link points to /mypage/one and another to /mypage/twoI don’t want to create subpages called “one” and “two”, but I want the included PHP file to do its custom stuff. Some stuff for “one” and other stuff for “two”.
How can I create such rewrite rules so that they work no matter what page (or subpage) you put the shorttag on?
How should the included PHP file handle the subpages (or sub-subpages)?
- The topic ‘Plugin contents with rewrite’ is closed to new replies.