From 606cdfb2c9756bef10401dc06b7a94ca28d481d2 Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Wed, 22 Oct 2025 13:49:33 +0000 Subject: [PATCH] Editor: Re-add support for text inputs to theme.json. Re-adds support for text input elements to theme.json originally included in [61023] that was accidently removed in a subsequent commit. This change also include the updated docblock for `@since 6.9.0`. Follow-up to [61023], [61031]. Props leemon, wildworks, ella, scruffian, cbravobernal, desrosj, davidbaumwald. Fixes #63878. Built from https://develop.svn.wordpress.org/trunk@61046 git-svn-id: http://core.svn.wordpress.org/trunk@60382 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json.php | 26 ++++++++++++++------------ wp-includes/version.php | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 26e997e5f3..598f3ba918 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -601,6 +601,7 @@ class WP_Theme_JSON { * @since 6.1.0 * @since 6.2.0 Added support for ':link' and ':any-link'. * @since 6.8.0 Added support for ':focus-visible'. + * @since 6.9.0 Added `textInput` and `select` elements. * @var array */ const VALID_ELEMENT_PSEUDO_SELECTORS = array( @@ -616,20 +617,21 @@ class WP_Theme_JSON { * @var string[] */ const ELEMENTS = array( - 'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity. - 'heading' => 'h1, h2, h3, h4, h5, h6', - 'h1' => 'h1', - 'h2' => 'h2', - 'h3' => 'h3', - 'h4' => 'h4', - 'h5' => 'h5', - 'h6' => 'h6', + 'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity. + 'heading' => 'h1, h2, h3, h4, h5, h6', + 'h1' => 'h1', + 'h2' => 'h2', + 'h3' => 'h3', + 'h4' => 'h4', + 'h5' => 'h5', + 'h6' => 'h6', // We have the .wp-block-button__link class so that this will target older buttons that have been serialized. - 'button' => '.wp-element-button, .wp-block-button__link', + 'button' => '.wp-element-button, .wp-block-button__link', // The block classes are necessary to target older content that won't use the new class names. - 'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption', - 'cite' => 'cite', - 'select' => 'select', + 'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption', + 'cite' => 'cite', + 'textInput' => 'textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=text],[type=tel],[type=url])', + 'select' => 'select', ); const __EXPERIMENTAL_ELEMENT_CLASS_NAMES = array( diff --git a/wp-includes/version.php b/wp-includes/version.php index fd7d602085..3f016c19bc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-beta1-61045'; +$wp_version = '6.9-beta1-61046'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.