Skip to content

Commit 7b61018

Browse files
committed
Global styles: add element support for text related inputs.
Adds elements support to text based form inputs so a theme can style consistently how forms should look like regardless of the plugins/blocks installed. Props onemaggie, mukesh27, sabernhardt, scruffian, get_dave, ocean90, mikachan, wildworks. Fixes #63878. git-svn-id: https://develop.svn.wordpress.org/trunk@61024 602fd350-edb4-49c9-b593-d223f7449a82
1 parent db71721 commit 7b61018

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -613,24 +613,22 @@ class WP_Theme_JSON {
613613
*
614614
* @since 5.8.0
615615
* @since 6.1.0 Added `heading`, `button`, and `caption` elements.
616-
* @since 6.9.0 Added `textInput` elements.
617616
* @var string[]
618617
*/
619618
const ELEMENTS = array(
620-
'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity.
621-
'heading' => 'h1, h2, h3, h4, h5, h6',
622-
'h1' => 'h1',
623-
'h2' => 'h2',
624-
'h3' => 'h3',
625-
'h4' => 'h4',
626-
'h5' => 'h5',
627-
'h6' => 'h6',
619+
'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity.
620+
'heading' => 'h1, h2, h3, h4, h5, h6',
621+
'h1' => 'h1',
622+
'h2' => 'h2',
623+
'h3' => 'h3',
624+
'h4' => 'h4',
625+
'h5' => 'h5',
626+
'h6' => 'h6',
628627
// We have the .wp-block-button__link class so that this will target older buttons that have been serialized.
629-
'button' => '.wp-element-button, .wp-block-button__link',
628+
'button' => '.wp-element-button, .wp-block-button__link',
630629
// The block classes are necessary to target older content that won't use the new class names.
631-
'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',
632-
'cite' => 'cite',
633-
'textInput' => 'textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=text],[type=tel],[type=url])',
630+
'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',
631+
'cite' => 'cite',
634632
);
635633

636634
const __EXPERIMENTAL_ELEMENT_CLASS_NAMES = array(

0 commit comments

Comments
 (0)