mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
Toolbar: Allow adding lang
and dir
attributes to toolbar items.
This is useful from a multilingual and accessibility perspective. Props Chouby, leemon. Fixes #33513. Built from https://develop.svn.wordpress.org/trunk@35795 git-svn-id: http://core.svn.wordpress.org/trunk@35759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
714d5885d9
commit
59351cb62d
@ -98,6 +98,8 @@ class WP_Admin_Bar {
|
||||
/**
|
||||
* Add a node to the menu.
|
||||
*
|
||||
* @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data.
|
||||
*
|
||||
* @param array $args {
|
||||
* Arguments for adding a node.
|
||||
*
|
||||
@ -106,7 +108,7 @@ class WP_Admin_Bar {
|
||||
* @type string $parent Optional. ID of the parent node.
|
||||
* @type string $href Optional. Link for the item.
|
||||
* @type bool $group Optional. Whether or not the node is a group. Default false.
|
||||
* @type array $meta Meta data including the following keys: 'html', 'class', 'rel',
|
||||
* @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir',
|
||||
* 'onclick', 'target', 'title', 'tabindex'. Default empty.
|
||||
* }
|
||||
*/
|
||||
@ -506,12 +508,24 @@ class WP_Admin_Bar {
|
||||
if ( ! empty( $node->meta['rel'] ) ) :
|
||||
?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
|
||||
endif;
|
||||
if ( ! empty( $node->meta['lang'] ) ) :
|
||||
?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
|
||||
endif;
|
||||
if ( ! empty( $node->meta['dir'] ) ) :
|
||||
?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
|
||||
endif;
|
||||
?>><?php
|
||||
else:
|
||||
?><div class="ab-item ab-empty-item" <?php echo $aria_attributes;
|
||||
if ( ! empty( $node->meta['title'] ) ) :
|
||||
?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
|
||||
endif;
|
||||
if ( ! empty( $node->meta['lang'] ) ) :
|
||||
?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php
|
||||
endif;
|
||||
if ( ! empty( $node->meta['dir'] ) ) :
|
||||
?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php
|
||||
endif;
|
||||
?>><?php
|
||||
endif;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-35794';
|
||||
$wp_version = '4.5-alpha-35795';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user