Opened 4 years ago
Last modified 15 months ago
#11215 new enhancement
Improve naming of child/parent theme functions
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Themes | Version: | 2.9 |
| Severity: | normal | Keywords: | |
| Cc: | johnjamesjacoby, georgemamadashvili@… |
Description
We have confusing naming for child/parent theme functions.
We have references to stylesheet/template instead of child/parent which makes it unclear which function should be being used.
In #11033 we introduced a function for loading the child themes textdomain with a clear name.
We should look at deprecating the stylesheet/template nomenclature and use child/parent instead.
Attachments (1)
Change History (14)
comment:2
johnjamesjacoby — 3 years ago
- Cc johnjamesjacoby added
I know the way phpBB does it is with template/style, but I'm not sure if a phpBB style allows PHP code to override, or if it's just a stylesheet thing.
I think because the terms theme and template have become synonymous, it's hard to say which direction to take. To me, theme/stye are basically the same thing.
Template - HTML
Theme/style - CSS/images
For the purpose of WordPress, parent/child probably makes the most sense, since it isn't template/theme/style specific in any way.
it's wordpress themes (not styles nor templates), I think that's the term set, so +1 for what filosofo writes.
westi, can you give examples of the function names you seem unfit and provide a suggestions how to rename them?
code refactored in functions get_current_theme, get_themes and get_theme_roots (bit off-topic, stumbled over it while reviewing the ticket)
I looked into this a bit more. The naming for theme/template/stylesheet related sutff are more simple/consistent than I first thought:
- theme (see current_theme options, example: "WordPress Classic")
- template (see template option, example: "classic", the actual string based identifier for 1.) theme .)
- stylesheet (see stylesheet option, example: "classic", for a definition what a stylesheet is, please see function get_stylesheet(), Quote: "the template name and the stylesheet name are going to be the same for most cases")
So I wonder where actually the reporter sees confusing function names. It would be good to name those so that a fix can be provided. I see the problem here that we only think function names are mixed up, infact they are not. The terms child/parent -theme might be new but the concept is not, right?
The confusing part is to people who do not understand what the Template and Stylsheet are, Yet know what the Parent and the Child are.
Most theme developers refer to them as Parent and Child themes, infact, most developers do too.
So the deal is, We should stop refering to them as Stylesheet and Template, and instead, refer to them as Parent and Child, a name that is clear cut and obvious to people (Instead of scratching your head, and thinking, now, is the child the template or the stylsheet...)
- Keywords dev-feedback added
Well then some clarification would be great. Can anyone tell me which of those are right or wrong?
- template is child
- stylesheet is child
- template is parent
- stylesheet is parent
- theme is child
- theme is parent
- theme can be parent or child
- template is child or parent
- stylesheet is child or parent
Clarification would be gratefull appreceated. Confirmation by core-devs much helpfull.
- Keywords dev-feedback removed
if no child, then template and stylesheet are parent; if child, then template is parent and stylesheet is child.
So this would be:
- template is parent
and
- stylesheet is child or parent
- Milestone changed from 3.0 to 3.1
Bumping to 3.1 as we're close to beta
comment:10
scribu — 3 years ago
Related: #14720
comment:11
nacin — 3 years ago
- Type changed from task (blessed) to enhancement
comment:12
nacin — 3 years ago
- Milestone changed from Awaiting Triage to Future Release
comment:13
Mamaduka — 15 months ago
- Cc georgemamadashvili@… added

I know you're not referring to this directly, but I think changes should keep the theme/template distinction in that a "theme" describes the overall set of functionality (e.g. the "Classic" theme), but "template" describes its individual files (e.g. "single.php", "author.php", "page.php").