| @@ -84,9 +84,20 @@ | ||
| 84 | 84 | $columns = array_slice( $columns, 0, $n ); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | foreach ( $this->model->get_languages_list() as $language ) { |
| 88 | - $columns[ 'language_' . $language->slug ] = $this->links->get_flag_html( $language ) . '<span class="screen-reader-text">' . esc_html( $language->name ) . '</span>'; | |
| 88 | + /* | |
| 89 | + * Hack: | |
| 90 | + * - `WP_Screen::render_list_table_columns_preferences()` applies `wp_strip_all_tags()` in the screen options: | |
| 91 | + * this will remove the flag, and reveal the language name (that looses its `<span>`). | |
| 92 | + * - `WP_List_Table::print_column_headers()` doesn't apply any escaping function in the column headers: | |
| 93 | + * the flag will be displayed, and the language name will still be present but visually hidden. | |
| 94 | + */ | |
| 95 | + $columns[ "language_{$language->slug}" ] = sprintf( | |
| 96 | + '%s<span class="screen-reader-text">%s</span>', | |
| 97 | + $language->get_admin_flag( 'aria-hidden' ), | |
| 98 | + esc_html( $language->name ) | |
| 99 | + ); | |
| 89 | 100 | } |
| 90 | 101 | |
| 91 | 102 | return isset( $end ) ? array_merge( $columns, $end ) : $columns; |
| 92 | 103 | } |
| @@ -454,9 +465,9 @@ | ||
| 454 | 465 | |
| 455 | 466 | $translations = array_merge( $translations, $this->model->term->get_translations( (int) $_POST['term_id'] ) ); |
| 456 | 467 | $translations = array_unique( $translations ); |
| 457 | 468 | |
| 458 | - if ( empty( $translations ) ) { // May occur if the modfied term has no language. | |
| 469 | + if ( empty( $translations ) ) { // May occur if the modified term has no language. | |
| 459 | 470 | $response->send(); |
| 460 | 471 | } |
| 461 | 472 | |
| 462 | 473 | /** @var WP_Term[] */ |