Changeset 54105
- Timestamp:
- 09/08/2022 04:43:01 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r53302 r54105 348 348 * 349 349 * @since 5.8.0 350 * @since 6.1.0 Added `heading`, `button`, and `caption` to the elements. 350 351 * @var string[] 351 352 */ 352 353 const ELEMENTS = array( 353 'link' => 'a', 354 'h1' => 'h1', 355 'h2' => 'h2', 356 'h3' => 'h3', 357 'h4' => 'h4', 358 'h5' => 'h5', 359 'h6' => 'h6', 354 'link' => 'a', 355 'heading' => 'h1, h2, h3, h4, h5, h6', 356 'h1' => 'h1', 357 'h2' => 'h2', 358 'h3' => 'h3', 359 'h4' => 'h4', 360 'h5' => 'h5', 361 'h6' => 'h6', 362 // We have the .wp-block-button__link class so that this will target older buttons that have been serialized. 363 'button' => '.wp-element-button, .wp-block-button__link', 364 // The block classes are necessary to target older content that won't use the new class names. 365 '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', 360 366 ); 361 367 … … 1477 1483 1478 1484 if ( isset( $theme_json['styles']['elements'] ) ) { 1479 foreach ( $theme_json['styles']['elements'] as $element => $node ) { 1485 foreach ( self::ELEMENTS as $element => $selector ) { 1486 if ( ! isset( $theme_json['styles']['elements'][ $element ] ) ) { 1487 continue; 1488 } 1480 1489 $nodes[] = array( 1481 1490 'path' => array( 'styles', 'elements', $element ),
Note: See TracChangeset
for help on using the changeset viewer.