I'm creating a plugin using Devlounge's How to Write a WordPress Plugin series.
Is it possible to create a custom template tag that utilizes the database?
There's a catch! The Devlounge tutorial places the entire plugin inside a class, so my database information isn't available outside of that class.
And apparently, functions inside PHP classes aren't available for use outside the class, so I can't just place my
<?php custom_template_tag() ?> inside my
If I define the function within the class, it's not possible to call the function from outside the class. If I define the function outside the class, it's not possible to get my database information.
I'm sure this is possible, but how? Something to do with
get_option, perhaps? Or some tricky PHP wizardry?