[wp-meta] [Making WordPress.org] #8011: Update theme.json example in Theme Handbook to use version 3 and correct data structure

Making WordPress.org noreply at wordpress.org
Sat Jun 14 12:12:22 UTC 2025


#8011: Update theme.json example in Theme Handbook to use version 3 and correct
data structure
-------------------------+--------------------
 Reporter:  tomd6r       |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  low          |  Milestone:
Component:  Handbooks    |   Keywords:
-------------------------+--------------------
 == Issue Description
 The Theme Handbook page on theme.json currently shows an outdated and
 partially incorrect example structure. The sample uses version 2, while
 the current recommended version is 3. Additionally, both `customTemplates`
 and `templateParts` are shown as objects, but they should be arrays.

 === URL of the Page with the Issue
 https://developer.wordpress.org/themes/core-concepts/global-settings-and-
 styles/#theme-json-structure

 == Why is this a problem?
 This outdated and incorrect example may mislead theme developers,
 especially those new to working with theme.json. Using the wrong version
 or incorrect data structures can result in unexpected behaviour or errors
 when registering templates or parts, leading to frustration and
 unnecessary debugging.

 == Suggested Fix
 Update the example to reflect the current standard format, using version
 3, and ensure that both `customTemplates` and `templateParts` are shown as
 arrays. For example:

 {{{#!json
 {
   "$schema": "https://schemas.wp.org/trunk/theme.json",
   "version": 3,
   "settings": {},
   "styles": {},
   "customTemplates": [],
   "templateParts": [],
   "patterns": []
 }
 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/8011>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list