Any WordPress plugin authors?

Status
Not open for further replies.
Hey all,

I finally had to dip my fingers in WordPress for a few upcoming sites. I'm researching plugins which turns out to be a really windy, twisty turn through a combo of the Codex and misc blog tutorials.

I'm writing a plugin with an admin panel the admins can enter data into. I'm creating a database table upon install to keep track of the data.

What I'm a bit confused on is the best practice way to display this data on the front face of the website. There's a bunch of logic that weaves the data the admin enters to display the page properly which is why I'm not just using the built in page/post CMS for this page.

Should I be hooking into a filter to look for a custom shortword and inject the display of the page there? Should I make a custom page template and put the code necessary there? What is the best practice way to display this page to the public?

Bonus points is not requiring the user to use the page or post system in the CMS at all. If I could create some kind of permalink myself to retrieve the data and let them link to it while having the template wrap around it, that'd be great!

How would you do it?
 
A friend has started doing some WordPress development to extend his own site and is looking to release what he has written.

One of them is a series index which is placed at the end of a post using a custom shortcode. I asked him and he has a plugin file with a function doing all the work

Then at the top is the following code:

Code:
add_shortcode( 'series-index', 'display_series_index' );

series-index is the shortcode added to the post wrapped in square brackets and display_series_index is the function name.
 
I knew I lost this post somewhere.. Thanks for the replies.

Yep I'm familiar with adding in a short code but as I mentioned if I add yet another shortword the system has to parse for then potentially the entire site is doing a very small amount of unnecessary work most almost all of the time.

I'm really looking for the method that would allow me to literally only execute specific code when I'm in the correct section, otherwise no code is run (no filters, no checking which page I'm on, etc). The equivalent of old style static sites where if you wanted specific code to run on a page, you made a new page and added what you needed, but no other page in the site ever ran it ;). The easy days..

I realize just using the filter system is only adding about 0.000000001% strain to the system, but it just feels wrong.

I'll give Django a shot as well, thanks :)
 
Not trying to beat a dead horse but that's exactly what I'm trying to avoid. In my previous example, old fashioned file-per-page sites only executed code in the file for that specific page. If you're not on that page, you waste zero time executing any irrelevant code.

That's the method I'm searching for in WordPress which appears to only be custom page templates (which is fine for a solution, unless there's a better way).

I don't even want to run a single line of code to check the current page I'm on to know if I should filter for the shortcode. That's code that runs (again, really really really really fast) but doesn't need to. I'm trying not to do anything I don't need to which is what I would prefer.

Just for the record I'm not irrational about performance. I favor composure over performance. I want the code to be easy to maintain and if any other author comes along to manage something I made I don't want it to be a nightmare to save "0.000000001% strain to the system".

But if I can have my cake and eat it too...
 
Status
Not open for further replies.