How can I write a plugin that adds another class of content to WP?
-
Hey,
So I’m writing this plugin for WordPress which lets people manage a tournament and display score tables and tournament brackets and such. I’ve got the administrative side working pretty well but now I need to work on how the data is displayed.
What I’ve got right now is a filter for “the_content” which looks for tags (similar to the wp-tables plugin) – if the proper tag is found, it’s replaced with data from the plugin.
The problem is that when I display a tournament bracket or something I want it to include links to other information: for instance, click on a single round of the tournament and you get linked to detailed information about that match and how it turned out.
The best answer I’ve come up with so far is to mimic how the WP-Forum plugin does things: when you display a page that contains the WP-forum tag, the WP-forum content is displayed, and if there’s additional GET queries in the URL apart from the page_id, then those are used by the content filter in order to determine what forum content to display or what action to take…
Alternately I could try writing my own PHP file in the plugin directory which I could link to by name – which would go through all the steps usually done to display a post, except show my content instead of displaying a post… But I’m not sure how to do that. Or I could create a new query for the site’s top-level, like instead of “page_id=5” I could have “tournament=2007-07” – but I don’t know how to do that, either…
Any help would be greatly appreciated. Thanks.
- The topic ‘How can I write a plugin that adds another class of content to WP?’ is closed to new replies.