Releases: Clark-Nikdel-Powell/Template-Library
ACF Updates
Foundation Accordions
v0.8.6 Merge branch 'master' of github.com:Clark-Nikdel-Powell/Template-Library
Fix Gallery class index check
v0.8.5 Add check to see if class index is set
Fix Gallery caption data-image attribute
v0.8.4 Fix $this->nam and caption data-image attribute
Better Header Backgrounds
Yup, backgrounds actually work now. How 'bout da'?
Organism cleanups
v0.8.2 updates to Accordion, Gallery and Header
Docs cleanup
Edited a couple of docs.
Rename get_content to set_content, add construct filter
In keeping up with yesterday's release where we clarified the purpose of get_content()
, I figured it's probably best to clarify the method name of get_content()
as well. To that end, get_content()
has been renamed to set_content()
. This could be a breaking change (test-driven development sure would be nice), so I've upped the version to 0.8.0.
Also, I added a filter to the end of the construct method with the suffix of "-construct" to solve a use case like a section header, where we sometimes need to replace the post object if we're on a post type archive.
Before, we had to replace the post object individually for every item that is set up in the Header_Section
class. Now, with the construct filter, we can replace the main post object (on the $data
property) and the other pieces that are set up after the main class construct method is completed will take that post object instead.
Refactor get_content method
I realized that the way we've used get_content()
in child Organisms is different than how we used it in the main Organism class when I tried to filter a PostTitle.
I filtered my text in, but then the PostTitle get_content()
method overwrote my filter text because get_content()
is called after do_filter()
in the Organism get_markup()
method.
To address this, I've refactored the Organism get_content()
method to be a placeholder. get_content()
is called before the do_filter()
call so that the content is finalized before filters are applied. The prepend, content, structure and append properties are now handled in the get_markup()
method instead.
To sum up, the get_content method is for setting the content property, not returning the prepend / content / structure / append properties.
This has the potential to be a breaking change for any child classes of Organism that are using get_content()
to return the content rather than set it. Do a local search for get_content()
before updating.