-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the hero to be filtered #724
Conversation
These changes abstracts the featured media stuff that Ryan built to make it possible to filter the generated hero DOM for overriding in child themes. #### Changes: - `partials/single-hero.php` is removed and replaced with two functions: `largo_hero()` (prints) and `largo_get_hero()` (returns). - Removes error checking where error checking is already done. - Replaces `largo_hero_with_caption()` with `largo_featured_image_hero()`. This is to keep consistency with newly introduced `largo_featured_gallery_hero()`, `largo_featured_embed_hero()`, &c. naming convention. This group of functions generate slightly different DOM for their respective hero type. Suggestions on how to handle depreciation appreciated. The function still exists to keep backwards compatibility, but we should have a system for depreciation (like [WordPress](https://developer.wordpress.org/reference/functions/_depreca ted_function/)). - adds `largo_get_hero` filter for overriding what is displayed by child themes.
This branch started from master with develop merged in, so Adam's 4311e9d commit made it in here. |
Tests appear to be working now. The change in 5ab45b2 is to the actual test itself, which appears to have an erroneous I scratched my head a lot looking at these tests. I can't find anything documenting what |
…es/additions tidying formatting
Thanks @willhaynes. I went ahead stubbed out tests for all of the new functions you added and factored the markup generated by |
These Changes abstracts the featured media stuff that Ryan built to make it possible to filter the generated hero DOM for overriding in child themes.
Changes:
partials/single-hero.php
is removed and replaced with two functions:largo_hero()
(prints) andlargo_get_hero()
(returns).largo_hero_with_caption()
withlargo_featured_image_hero()
. This is to keep consistency with newly introducedlargo_featured_gallery_hero()
,largo_featured_embed_hero()
, &c. naming convention. This group of functions generate slightly different DOM for their respective hero type. Suggestions on how to handle depreciation appreciated. The function still exists to keep backwards compatibility, but we should have a system for depreciation (like WordPress).largo_get_hero
filter for overriding what is displayed by child themes.