Make WordPress Core

Changeset 50987


Ignore:
Timestamp:
05/25/2021 01:42:20 AM (5 years ago)
Author:
jorbin
Message:

Formatting: Add 'main' tag to kses

main is a valid HTML element that is especially valuable for KSES to support in light of full site editing.

Related: ​https://github.com/WordPress/gutenberg/pull/28576 for the addition of main to the group block.

Fixes #53156.
Props glendaviesnz.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r50923 r50987  
    252252                        'align' => true,
    253253                        'value' => true,
     254                ),
     255                'main'        => array(
     256                        'align'    => true,
     257                        'dir'      => true,
     258                        'lang'     => true,
     259                        'xml:lang' => true,
    254260                ),
    255261                'map'        => array(
  • trunk/tests/phpunit/tests/kses.php

    r50923 r50987  
    14791479                $this->assertSame( $html, wp_kses_post( $html ) );
    14801480        }
     1481
     1482        /**
     1483         * Test filtering a standard main tag.
     1484         *
     1485         * @ticket 53156
     1486         */
     1487        function test_wp_kses_main_tag_standard_attributes() {
     1488                $test = array(
     1489                        '<main',
     1490                        'class="wp-group-block"',
     1491                        'style="padding:10px"',
     1492                        '/>',
     1493                );
     1494
     1495                $html = implode( ' ', $test );
     1496
     1497                $this->assertSame( $html, wp_kses_post( $html ) );
     1498        }
    14811499}
Note: See TracChangeset for help on using the changeset viewer.