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

Bugfix/34 shortcode attr content processing #35

Closed jmichaelward closed 4 years ago

jmichaelward commented 4 years ago

This PR closes #34 and has the added benefit of potentially clarifying some of the discussion in #27.

Assigning @salcode and @ravewebdev as reviewers on this - the former because he's been a gracious participant in the repository, and the latter because I discovered today that she'd encountered issues with this structure that this PR should hopefully resolve.

jmichaelward commented 4 years ago

Looks good, working on my local - only issue I ran into is that my shortcode's render method wasn't explicitly typehinting the return value and threw an error, but I fixed that and now no more errors.

@ravewebdev Yep, that's exactly what I would expect, which is why the typehint is important - it forces engineers to abide by the contract. In this case, "shortcodes must return a string". Thanks for the feedback!

jmichaelward commented 4 years ago

Based on Rebekah's feedback and having implemented all of the requested changes, I'm going to merge this in and start preparing an 0.3.0 release. We can do a subsequent bugfix if needed.