Skip to content

Commit

Permalink
Editor: Add a description key to theme.json style variations.
Browse files Browse the repository at this point in the history
This changeset adds `description` to `VALID_TOP_LEVEL_KEYS` in `class-wp-theme-json.php` to allow for accessibility improvements. The description is added to 
the ARIA label of the style variation container. If the style variation has no description, only the title is used. One purpose is to use the text description 
to improve the style variation preview in the WordPress.org theme directory.

See WordPress/gutenberg#45242.

Props ramonopoly, poena.
Fixes #58614.

 --Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    trunk/src/wp-includes/class-wp-theme-json.php


git-svn-id: https://develop.svn.wordpress.org/trunk@56041 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Jun 26, 2023
1 parent d638b01 commit 88de9a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,12 @@ class WP_Theme_JSON {
* @since 5.8.0 As `ALLOWED_TOP_LEVEL_KEYS`.
* @since 5.9.0 Renamed from `ALLOWED_TOP_LEVEL_KEYS` to `VALID_TOP_LEVEL_KEYS`,
* added the `customTemplates` and `templateParts` values.
* @since 6.3.0 Added the `description` value.
* @var string[]
*/
const VALID_TOP_LEVEL_KEYS = array(
'customTemplates',
'description',
'patterns',
'settings',
'styles',
Expand Down

0 comments on commit 88de9a9

Please sign in to comment.