WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 3 years ago

#11215 closed enhancement (wontfix)

Improve naming of child/parent theme functions

Reported by: westi Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Themes Keywords:
Focuses: Cc:

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)

11215-code-get_current_theme.patch (2.2 KB) - added by hakre 7 years ago.
code refactored in functions get_current_theme, get_themes and get_theme_roots (bit off-topic, stumbled over it while reviewing the ticket)

Download all attachments as: .zip

Change History (15)

#1 @filosofo
8 years ago

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").

#2 @johnjamesjacoby
7 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.

#3 @hakre
7 years ago

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?

@hakre
7 years ago

code refactored in functions get_current_theme, get_themes and get_theme_roots (bit off-topic, stumbled over it while reviewing the ticket)

#4 @hakre
7 years ago

I looked into this a bit more. The naming for theme/template/stylesheet related sutff are more simple/consistent than I first thought:

  1. theme (see current_theme options, example: "WordPress Classic")
  2. template (see template option, example: "classic", the actual string based identifier for 1.) theme .)
  3. 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?

#5 @dd32
7 years ago

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...)

#6 @hakre
7 years ago

  • Keywords dev-feedback added

Well then some clarification would be great. Can anyone tell me which of those are right or wrong?

  1. template is child
  2. stylesheet is child
  3. template is parent
  4. stylesheet is parent
  5. theme is child
  6. theme is parent
  7. theme can be parent or child
  8. template is child or parent
  9. stylesheet is child or parent

Clarification would be gratefull appreceated. Confirmation by core-devs much helpfull.

#7 @Denis-de-Bernardy
7 years ago

  • Keywords dev-feedback removed

if no child, then template and stylesheet are parent; if child, then template is parent and stylesheet is child.

#8 @hakre
7 years ago

So this would be:

  1. template is parent

and

  1. stylesheet is child or parent

#9 @dd32
7 years ago

  • Milestone changed from 3.0 to 3.1

Bumping to 3.1 as we're close to beta

#10 @scribu
7 years ago

Related: #14720

#11 @nacin
7 years ago

  • Type changed from task (blessed) to enhancement

#12 @nacin
7 years ago

  • Milestone changed from Awaiting Triage to Future Release

#13 @Mamaduka
5 years ago

  • Cc georgemamadashvili@… added

#14 @ocean90
3 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

That ship sailed a long time ago.

Note: See TracTickets for help on using tickets.