wp/wp-includes/widgets/class-wp-widget-tag-cloud.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    50 			} else {
    50 			} else {
    51 				$tax   = get_taxonomy( $current_taxonomy );
    51 				$tax   = get_taxonomy( $current_taxonomy );
    52 				$title = $tax->labels->name;
    52 				$title = $tax->labels->name;
    53 			}
    53 			}
    54 		}
    54 		}
       
    55 
       
    56 		$default_title = $title;
    55 
    57 
    56 		$show_count = ! empty( $instance['count'] );
    58 		$show_count = ! empty( $instance['count'] );
    57 
    59 
    58 		$tag_cloud = wp_tag_cloud(
    60 		$tag_cloud = wp_tag_cloud(
    59 			/**
    61 			/**
    98 
   100 
    99 		if ( 'html5' === $format ) {
   101 		if ( 'html5' === $format ) {
   100 			// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
   102 			// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
   101 			$title      = trim( strip_tags( $title ) );
   103 			$title      = trim( strip_tags( $title ) );
   102 			$aria_label = $title ? $title : $default_title;
   104 			$aria_label = $title ? $title : $default_title;
   103 			echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
   105 			echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
   104 		}
   106 		}
   105 
   107 
   106 		echo '<div class="tagcloud">';
   108 		echo '<div class="tagcloud">';
   107 
   109 
   108 		echo $tag_cloud;
   110 		echo $tag_cloud;