#31374 closed defect (bug) (fixed)
Twenty Fourteen: twentyfourteen_post_thumbnail() should be pluggable
Reported by: | WordPressor.ru | Owned by: | lancewillett |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Bundled Theme | Keywords: | has-patch needs-docs |
Focuses: | template | Cc: |
Description
Hi all, this is my first.
In file wp-content/themes/twentyfourteen/inc/template-tags.php, there is missed "if ( ! function_exists(" around function twentyfourteen_post_thumbnail. So I can't redefine this function in my child theme.
I'm using WP 4.1, Twentyfourteen theme 1.3.
See my diff, hope i made it right.
Also, there are same construction missing around function twentyfourteen_categorized_blog in same template-tag.php.
Attachments (2)
Change History (12)
#2
@
10 years ago
- Keywords has-patch commit added
- Milestone changed from Awaiting Review to 4.2
Good catch, twentyfifteen_post_thumbnail()
is pluggable in Twenty Fifteen.
Makes sense for twentyfourteen_post_thumbnail()
to be pluggable too.
#3
@
10 years ago
- Summary changed from Missed "if ( ! function_exists(" around function twentyfourteen_post_thumbnail to Twenty Fourteen: twentyfourteen_post_thumbnail() should be pluggable
#4
@
10 years ago
- Owner set to lancewillett
- Resolution set to fixed
- Status changed from new to closed
In 31481:
#5
@
10 years ago
- Keywords needs-docs added; commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
I'd like to have a changelog entry added to the phpDoc for this function mentioning that it was made pluggable in Twenty Fourteen 1.X
#6
follow-up:
↓ 7
@
10 years ago
Thank you all!
What about twentyfourteen_categorized_blog() in the same file?
I fixed them both in combined patch.
#7
in reply to:
↑ 6
@
10 years ago
Replying to WordPressor.ru:
What about twentyfourteen_categorized_blog() in the same file?
As mentioned in comment:1, twentyfourteen_categorized_blog()
seems specific and probably doesn't need to be overridden. It's not pluggable in Twenty Fifteen either.
Is there an actual use case for it to be overridden?
[Changing my comment since the original was wrong.]
Hi! Just a note about why
twentyfourteen_categorized_blog
doesn't have afunction_exists
around it. If I recall correctly there was discussion about a related issue elsewhere. The reasoning there was that the function is so specific that it doesn't need to be overridden. Reasoning may have changed since then. I'm sure others can provide better context but I wanted to chime in about why that doesn't have a function check around it.