#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)
#1
@
9 years ago
#2
@
9 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
@
9 years ago
- Summary changed from Missed "if ( ! function_exists(" around function twentyfourteen_post_thumbnail to Twenty Fourteen: twentyfourteen_post_thumbnail() should be pluggable
#4
@
9 years ago
- Owner set to lancewillett
- Resolution set to fixed
- Status changed from new to closed
In 31481:
#5
@
9 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
@
9 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
@
9 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?
Hi! Just a note about why
twentyfourteen_categorized_blog
doesn't have afunction_exists
around it. You will see below that the code that uses this function is as follows:Making that function pluggable is somewhat redundant. If someone doesn't want to use it then he can remove the action from
save_post
andedit_category
, thus there's no need for the function check.