Changeset 38035 for trunk/src/wp-includes/class-wp-admin-bar.php
- Timestamp:
- 07/12/2016 11:18:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-admin-bar.php
r37985 r38035 478 478 $has_link = ! empty( $node->href ); 479 479 480 $tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : ''; 481 $aria_attributes = $tabindex ? 'tabindex="' . $tabindex . '"' : ''; 480 // Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y. 481 $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : ''; 482 $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : ''; 482 483 483 484 $menuclass = ''; … … 498 499 <li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php 499 500 if ( $has_link ): 500 ?><a class="ab-item" 501 ?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php 501 502 if ( ! empty( $node->meta['onclick'] ) ) : 502 503 ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php … … 519 520 ?>><?php 520 521 else: 521 ?><div class="ab-item ab-empty-item" 522 ?><div class="ab-item ab-empty-item"<?php echo $aria_attributes; 522 523 if ( ! empty( $node->meta['title'] ) ) : 523 524 ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
Note: See TracChangeset
for help on using the changeset viewer.