113 | | * @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir', |
114 | | * 'onclick', 'target', 'title', 'tabindex'. Default empty. |
| 114 | * @type array $meta { |
| 115 | * Optional. HTML attributes (except for 'html', see below) |
| 116 | * |
| 117 | * @type string $html Arbitrary HTML markup output after the node |
| 118 | * @type string xxx Arbitrary HTML attribute |
| 119 | * } |
501 | | ?><a class="ab-item"<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php |
502 | | if ( ! empty( $node->meta['onclick'] ) ) : |
503 | | ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php |
504 | | endif; |
505 | | if ( ! empty( $node->meta['target'] ) ) : |
506 | | ?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php |
507 | | endif; |
508 | | if ( ! empty( $node->meta['title'] ) ) : |
509 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
510 | | endif; |
511 | | if ( ! empty( $node->meta['rel'] ) ) : |
512 | | ?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php |
513 | | endif; |
514 | | if ( ! empty( $node->meta['lang'] ) ) : |
515 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
516 | | endif; |
517 | | if ( ! empty( $node->meta['dir'] ) ) : |
518 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
519 | | endif; |
520 | | ?>><?php |
| 515 | ?><a<?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php |
| 516 | foreach ( $node->meta as $attr => $value ) { |
| 517 | if ( in_array($attr, array( 'aria-haspopup', 'href', 'html', ) ) || empty( $value ) ) { |
| 518 | continue ; |
| 519 | } |
| 520 | |
| 521 | // @todo it would probably be a good idea to sanitize the attribute name |
| 522 | // AFAIK core doesn't current contain a func to do that, should one be added? |
| 523 | echo sprintf (" $attr=\"%s\"", |
| 524 | stripos ( $attr, 'on' ) === 0 ? esc_js( $value ) : esc_attr( $value ) ); |
| 525 | } |
| 526 | ?>><?php |
522 | | ?><div class="ab-item ab-empty-item"<?php echo $aria_attributes; |
523 | | if ( ! empty( $node->meta['title'] ) ) : |
524 | | ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php |
525 | | endif; |
526 | | if ( ! empty( $node->meta['lang'] ) ) : |
527 | | ?> lang="<?php echo esc_attr( $node->meta['lang'] ); ?>"<?php |
528 | | endif; |
529 | | if ( ! empty( $node->meta['dir'] ) ) : |
530 | | ?> dir="<?php echo esc_attr( $node->meta['dir'] ); ?>"<?php |
531 | | endif; |
532 | | ?>><?php |
| 528 | ?><div<?php echo $aria_attributes; |
| 529 | foreach ( $node->meta as $attr => $value ) { |
| 530 | if ( in_array($attr, array( 'aria-haspopup', 'html', ) ) || empty( $value ) ) { |
| 531 | continue ; |
| 532 | } |
| 533 | |
| 534 | // @todo it would probably be a good idea to sanitize the attribute name |
| 535 | // AFAIK core doesn't current contain a func to do that, should one be added? |
| 536 | echo sprintf (" $attr=\"%s\"", |
| 537 | stripos ( $attr, 'on' ) === 0 ? esc_js( $value ) : esc_attr( $value ) ); |
| 538 | }?>><?php |