I think this about covers everything that would be needed to set up a new Shortcode object. This PR includes a new interface, Renderable, which would be useful for any objects that need to render content to the screen. As far as I can recall, all shortcodes get rendered, so this should be a valid use case for this interface in the abstract class.
I also added some light validation to throw an exception if the shortcode isn't set or if it isn't a string, but we could probably extend that to ensure they actually adhere to WordPress's expectation.
Closes #2
I think this about covers everything that would be needed to set up a new
Shortcode
object. This PR includes a new interface,Renderable
, which would be useful for any objects that need to render content to the screen. As far as I can recall, all shortcodes get rendered, so this should be a valid use case for this interface in the abstract class.I also added some light validation to throw an exception if the shortcode isn't set or if it isn't a string, but we could probably extend that to ensure they actually adhere to WordPress's expectation.