496 | | <li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php |
497 | | if ( $has_link ): |
498 | | ?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php |
499 | | if ( ! empty( $node->meta['onclick'] ) ) : |
500 | | ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php |
501 | | endif; |
502 | | if ( ! empty( $node->meta['target'] ) ) : |
503 | | ?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php |
504 | | endif; |
505 | | if ( ! empty( $node->meta['title'] ) ) : |
506 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
507 | | endif; |
508 | | if ( ! empty( $node->meta['rel'] ) ) : |
509 | | ?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php |
510 | | endif; |
511 | | if ( ! empty( $node->meta['lang'] ) ) : |
512 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
513 | | endif; |
514 | | if ( ! empty( $node->meta['dir'] ) ) : |
515 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
516 | | endif; |
517 | | ?>><?php |
518 | | else: |
519 | | ?><div class="ab-item ab-empty-item"<?php echo $aria_attributes; |
520 | | if ( ! empty( $node->meta['title'] ) ) : |
521 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
522 | | endif; |
523 | | if ( ! empty( $node->meta['lang'] ) ) : |
524 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
525 | | endif; |
526 | | if ( ! empty( $node->meta['dir'] ) ) : |
527 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
528 | | endif; |
529 | | ?>><?php |
530 | | endif; |
531 | | |
532 | | echo $node->title; |
533 | | |
534 | | if ( $has_link ) : |
535 | | ?></a><?php |
536 | | else: |
537 | | ?></div><?php |
538 | | endif; |
539 | | |
540 | | if ( $is_parent ) : |
541 | | ?><div class="ab-sub-wrapper"><?php |
542 | | foreach ( $node->children as $group ) { |
543 | | $this->_render_group( $group ); |
544 | | } |
545 | | ?></div><?php |
546 | | endif; |
| 496 | if ( $has_link ) { |
| 497 | $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); |
| 498 | echo "<a class='ab-item'$aria_attributes href='" . esc_url( $node->href ) . "'>"; |
| 499 | if ( ! empty( $node->meta['onclick'] ) ) { |
| 500 | echo ' onclick="' . esc_js( $node->meta['onclick'] ) . '"'; |
| 501 | } |
| 502 | } else { |
| 503 | $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); |
| 504 | echo '<div class="ab-item ab-empty-item"' . $aria_attributes; |
| 505 | } |
| 506 | |
| 507 | foreach ( $attributes as $attribute ) { |
| 508 | if ( ! empty( $node->meta[ $attribute ] ) ) { |
| 509 | echo " $attribute='" . esc_attr( $node->meta[ $attribute ] ) . '"'; |
| 510 | } |
| 511 | } |