| 121 | | $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"'; |
| | 123 | $atts['title'] = strip_tags( apply_filters( 'category_description', $category->description, $category ) ); |
| | 124 | } |
| | 125 | |
| | 126 | /** |
| | 127 | * Filters the HTML attributes applied to a category menu item's anchor element. |
| | 128 | * |
| | 129 | * @since 4.8.x |
| | 130 | * |
| | 131 | * @param array $atts { |
| | 132 | * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored. |
| | 133 | * |
| | 134 | * @type string $href The href attribute. |
| | 135 | * @type string $title The title attribute. |
| | 136 | * } |
| | 137 | * @param WP_Term $category Term data object. |
| | 138 | * @param int $depth Depth of category, used for padding. |
| | 139 | * @param array $args An array of arguments. |
| | 140 | * @param int $current_category ID of the current category. |
| | 141 | */ |
| | 142 | $atts = apply_filters( 'category_menu_link_attributes', $atts, $category, $depth, $args, $id ); |
| | 143 | |
| | 144 | $attributes = ''; |
| | 145 | foreach ( $atts as $attr => $value ) { |
| | 146 | if ( ! empty( $value ) ) { |
| | 147 | $value = esc_attr( $value ); |
| | 148 | $attributes .= ' ' . $attr . '="' . $value . '"'; |
| | 149 | } |