Update WordPress to 5.2
This commit is contained in:
parent
489b5a5914
commit
e00f87f2f5
599 changed files with 119573 additions and 55990 deletions
|
@ -501,14 +501,17 @@ class WP_Admin_Bar {
|
|||
return;
|
||||
}
|
||||
|
||||
$is_parent = ! empty( $node->children );
|
||||
$has_link = ! empty( $node->href );
|
||||
$is_parent = ! empty( $node->children );
|
||||
$has_link = ! empty( $node->href );
|
||||
$is_root_top_item = 'root-default' === $node->parent;
|
||||
$is_top_secondary_item = 'top-secondary' === $node->parent;
|
||||
|
||||
// Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y.
|
||||
$tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : '';
|
||||
$aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
|
||||
|
||||
$menuclass = '';
|
||||
$arrow = '';
|
||||
|
||||
if ( $is_parent ) {
|
||||
$menuclass = 'menupop ';
|
||||
|
@ -519,6 +522,11 @@ class WP_Admin_Bar {
|
|||
$menuclass .= $node->meta['class'];
|
||||
}
|
||||
|
||||
// Print the arrow icon for the menu children with children.
|
||||
if ( ! $is_root_top_item && ! $is_top_secondary_item && $is_parent ) {
|
||||
$arrow = '<span class="wp-admin-bar-arrow" aria-hidden="true"></span>';
|
||||
}
|
||||
|
||||
if ( $menuclass ) {
|
||||
$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
|
||||
}
|
||||
|
@ -542,7 +550,7 @@ class WP_Admin_Bar {
|
|||
}
|
||||
}
|
||||
|
||||
echo ">{$node->title}";
|
||||
echo ">{$arrow}{$node->title}";
|
||||
|
||||
if ( $has_link ) {
|
||||
echo '</a>';
|
||||
|
@ -588,6 +596,7 @@ class WP_Admin_Bar {
|
|||
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );
|
||||
add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );
|
||||
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );
|
||||
add_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 8 );
|
||||
|
||||
// Site related.
|
||||
add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue