WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 2 years ago

#16883 new enhancement

Add check for "Template Version" on theme activation

Reported by: nathanrice Owned by:
Milestone: Awaiting Review 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)

#1 @mikeschinkel
7 years ago

  • Cc mikeschinkel@… added

#2 @cais
7 years ago

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.

#3 @cais
7 years ago

  • Cc edward.caissie@… added

#4 @nathanrice
7 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 @cais
7 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.

#6 @smub
7 years ago

This is a great idea Nathan. This would certainly help keep the standards high.

#7 @travisnorthcutt
7 years ago

  • Cc travis@… added

#8 @lancewillett
7 years ago

  • Cc lance@… added

#9 @F J Kaiser
7 years ago

  • Cc 24-7@… added

#10 @chriscct7
4 years ago

  • Focuses administration added
  • Keywords dev-feedback added

This is a really interesting idea. Tagging for core feedback

#11 @chriscct7
3 years ago

  • Keywords 2nd-opinion removed

This ticket was mentioned in Slack in #themereview by cais. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.