WebDevStudios / oops-wp

A collection of abstract classes, interfaces, and traits to promote object-oriented programming practices in WordPress.
57 stars 9 forks source link

The Shortcode class callback does not process attributes or content. #34

Closed jmichaelward closed 4 years ago

jmichaelward commented 4 years ago

This is a pretty major oversight on my part.

The original Shortcode implementation as it exists calls the render method on the object, but doesn't actually pass in the parameters that the shortcode callback requires: attributes, content, and the shortcode tag itself.

I think we can create a backward-compatible bugfix by adding two class properties: attributes and content, and updating the callback to a new process method instead. process will assign the class properties, then call the render method. This will make the shortcode attributes and content available to extending objects without affecting the overall interface.

jmichaelward commented 4 years ago

This has been merged and included in the 0.3.0 release.