Ticket #37513: 37513.4.diff
File 37513.4.diff, 2.8 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class-wp-admin-bar.php
501 501 return; 502 502 } 503 503 504 $is_parent = ! empty( $node->children ); 505 $has_link = ! empty( $node->href ); 504 $is_parent = ! empty( $node->children ); 505 $has_link = ! empty( $node->href ); 506 $is_root_top_item = 'root-default' === $node->parent; 507 $is_top_secondary_item = 'top-secondary' === $node->parent; 506 508 507 509 // Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y. 508 510 $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : ''; … … 509 511 $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : ''; 510 512 511 513 $menuclass = ''; 514 $arrow = ''; 512 515 513 516 if ( $is_parent ) { 514 517 $menuclass = 'menupop '; … … 519 522 $menuclass .= $node->meta['class']; 520 523 } 521 524 525 // Print the arrow icon for the menu children with children. 526 if ( ! $is_root_top_item && ! $is_top_secondary_item && $is_parent ) { 527 $arrow = '<span class="wp-admin-bar-arrow" aria-hidden="true"></span>'; 528 } 529 522 530 if ( $menuclass ) { 523 531 $menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"'; 524 532 } … … 542 550 } 543 551 } 544 552 545 echo ">{$ node->title}";553 echo ">{$arrow}{$node->title}"; 546 554 547 555 if ( $has_link ) { 548 556 echo '</a>'; -
src/wp-includes/css/admin-bar.css
228 228 229 229 #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon, 230 230 #wpadminbar .ab-icon, 231 #wpadminbar .ab-item:before { 231 #wpadminbar .ab-item:before, 232 .wp-admin-bar-arrow { 232 233 position: relative; 233 234 float: left; 234 235 font: normal 20px/1 dashicons; … … 305 306 color: #00b9eb; 306 307 } 307 308 308 #wpadminbar .menupop .menupop > .ab-item :before,309 #wpadminbar .menupop .menupop > .ab-item .wp-admin-bar-arrow:before, 309 310 #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before { 310 311 position: absolute; 311 312 font: normal 17px/1 dashicons; … … 319 320 padding-right: 2em; 320 321 } 321 322 322 #wpadminbar .menupop .menupop > .ab-item :before {323 #wpadminbar .menupop .menupop > .ab-item .wp-admin-bar-arrow:before { 323 324 top: 1px; 324 right: 4px; 325 right: 10px; 326 padding: 4px 0; 325 327 content: "\f139"; 326 328 color: inherit; 327 329 } … … 331 333 padding-right: 1em; 332 334 } 333 335 334 #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item :before {336 #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item .wp-admin-bar-arrow:before { 335 337 top: 1px; 336 338 left: 6px; 337 339 content: "\f141";