Opened 14 years ago
Last modified 6 years ago
#16883 new enhancement
Add check for "Template Version" on theme activation
Reported by: | nathanrice | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Themes | Keywords: | needs-patch dev-feedback |
Focuses: | administration | Cc: |
Description
Related: #16395
In addition to adding Template Version to the standard meta information extracted from style.css in get_theme_data()
, I think that for this information to be useful, a child theme shouldn't be able to be activated unless the template template the child theme uses (parent theme) meets the minimum version requirement identified in "Template Version".
A polite and graceful failure, with an error notice, would be preferable :-)
Reason: many times child themes utilize functionality that only exists in the latest version of a parent theme. They're stuck either writing backward compatibility into into their code, or risking whitescreens.
This not only prevents that, but it could be used to gently encourage the user to update the parent theme.
Certainly not a candidate for 3.1.1, but perhaps 3.2?
Change History (12)
#4
@
14 years ago
@cais
Yes, that's what I'm saying. Hopefully the ticket wording isn't unclear. The Template Version tag is a way for the child theme to say "I require AT LEAST {Template Version} to run properly. If {Template} isn't at least {Template Version}, don't let me activate, and provide a nice little message to anyone who tries to activate me that says 'This theme requires {Template} {Template Version}. Please upgrade {Template}'"
Basically, it'd be nice if Template Version wasn't just a suggestion or reminder. It'd be nice if it had actual functional utility. I think that UX beats the pants off of whitescreens due to a child theme calling a function that doesn't exist in their version of {Template}.
#5
@
14 years ago
@nathanrice - We seem to be writing about the same basic idea ... part of the utility of "Template Version" is to test for the Parent-Theme version at upload / submission.
Have a look at the "Theme Check" plugin, it is already implementing this to a degree.
I imagine adding the additional UX functionality you are suggesting could also be implemented.
#10
@
10 years ago
- Focuses administration added
- Keywords dev-feedback added
This is a really interesting idea. Tagging for core feedback
The "Template Version" represents the Parent-Theme version the Child-Theme was written for. The implication is to insure the Child-Theme author maintains its code to match the current Parent-Theme in the repository.
An unobtrusive notice to advise the end-user the Child-Theme's Template (Parent-Theme) Version has been raised would be nice as a reminder but may also be detrimental to the overall UX.