| 4194 | |
| 4195 | /** |
| 4196 | * Wrap two text strings in appropriate HTML to display one on screen and present the other to a screen reader. |
| 4197 | * |
| 4198 | * @since |
| 4199 | * |
| 4200 | * @param string $display_text The text to display on screen |
| 4201 | * @param string $screen_reader_alternative_text The text to present to screen readers |
| 4202 | * @return string |
| 4203 | */ |
| 4204 | function get_aria_text_combination( $display_text, $screen_reader_alternative_text ) { |
| 4205 | /** |
| 4206 | * Filter the HTML class attribute of the screen reader element. |
| 4207 | * |
| 4208 | * @since |
| 4209 | * |
| 4210 | * @param string The HTML class attribute to add to the screen reader element |
| 4211 | */ |
| 4212 | $screen_reader_element_class = apply_filters( 'screen_reader_alternative_text_classname', 'screen-reader-text' ); |
| 4213 | return '<span aria-hidden="true">' . esc_html( $display_text ) . '</span><span class="' . esc_attr( $screen_reader_element_class ). '"> ' . esc_html( $screen_reader_alternative_text ) . '</span>'; |
| 4214 | } |