Make WordPress Core

Ticket #30421: aria-kses-1.diff

File aria-kses-1.diff, 2.3 KB (added by mattheu, 10 years ago)

Add all aria attributes to global attributes

  • src/wp-includes/kses.php

    diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php
    index ba96b08..d9a8c22 100644
    a b function _wp_add_global_attributes( $value ) { 
    15361536        if ( true === $value )
    15371537                $value = array();
    15381538
    1539         if ( is_array( $value ) )
    1540                 return array_merge( $value, $global_attributes );
     1539        if ( is_array( $value ) ) {
     1540                return array_merge( $value, $global_attributes, _wp_get_aria_attributes() );
     1541        }
    15411542
    15421543        return $value;
    15431544}
     1545
     1546
     1547function _wp_get_aria_attributes() {
     1548
     1549        $global_attributes = array(
     1550                'aria-atomic' => true,
     1551                'aria-busy' => true,
     1552                'aria-controls' => true,
     1553                'aria-describedby' => true,
     1554                'aria-disabled' => true,
     1555                'aria-dropeffect' => true,
     1556                'aria-flowto' => true,
     1557                'aria-grabbed' => true,
     1558                'aria-haspopup' => true,
     1559                'aria-hidden' => true,
     1560                'aria-invalid' => true,
     1561                'aria-label' => true,
     1562                'aria-labelledby' => true,
     1563                'aria-live' => true,
     1564                'aria-owns' => true,
     1565                'aria-relevant' => true,
     1566        );
     1567
     1568        $widget_attributes = array(
     1569                'aria-autocomplete' => true,
     1570                'aria-checked' => true,
     1571                'aria-disabled' => true,
     1572                'aria-expanded' => true,
     1573                'aria-haspopup' => true,
     1574                'aria-hidden' => true,
     1575                'aria-invalid' => true,
     1576                'aria-label' => true,
     1577                'aria-level' => true,
     1578                'aria-multiline' => true,
     1579                'aria-multiselectable' => true,
     1580                'aria-orientation' => true,
     1581                'aria-pressed' => true,
     1582                'aria-readonly' => true,
     1583                'aria-required' => true,
     1584                'aria-selected' => true,
     1585                'aria-sort' => true,
     1586                'aria-valuemax' => true,
     1587                'aria-valuemin' => true,
     1588                'aria-valuenow' => true,
     1589                'aria-valuetext' => true,
     1590        );
     1591
     1592        $live_region_attributes = array(
     1593                'aria-atomic' => true,
     1594                'aria-busy' => true,
     1595                'aria-live' => true,
     1596                'aria-relevant' => true,
     1597        );
     1598
     1599        $drag_drop_attributes = array(
     1600                'aria-dropeffect' => true,
     1601                'aria-grabbed' => true,
     1602        );
     1603
     1604        $relationship_attributes = array(
     1605                'aria-activedescendant' => true,
     1606                'aria-controls' => true,
     1607                'aria-describedby' => true,
     1608                'aria-flowto' => true,
     1609                'aria-labelledby' => true,
     1610                'aria-owns' => true,
     1611                'aria-posinset' => true,
     1612                'aria-setsize' => true,
     1613        );
     1614
     1615        return array_merge(
     1616                $global_attributes,
     1617                $live_region_attributes,
     1618                $widget_attributes,
     1619                $drag_drop_attributes,
     1620                $relationship_attributes
     1621        );
     1622
     1623}