| @@ -26,10 +26,14 @@ | ||
| 26 | 26 | /** |
| 27 | 27 | * Add body class : wplingua-list |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | - foreach ( $dom->find( 'body[class]' ) as $element ) { | |
| 31 | - $element->class = $element->class . ' wplingua-list'; | |
| 30 | + foreach ( $dom->find( 'body' ) as $element ) { | |
| 31 | + if ( ! empty( $element->class ) ) { | |
| 32 | + $element->class = $element->class . ' wplingua-list'; | |
| 33 | + } else { | |
| 34 | + $element->class = 'wplingua-list'; | |
| 35 | + } | |
| 32 | 36 | } |
| 33 | 37 | |
| 34 | 38 | /** |
| 35 | 39 | * Add list assets |
| @@ -60,9 +64,9 @@ | ||
| 60 | 64 | $language_current_id = $args['language_target']; |
| 61 | 65 | $languages_target = wplng_get_languages_target(); |
| 62 | 66 | |
| 63 | 67 | if ( empty( $languages_target ) ) { |
| 64 | - return ''; | |
| 68 | + return $dom; | |
| 65 | 69 | } |
| 66 | 70 | |
| 67 | 71 | $class = wplng_get_switcher_class( |
| 68 | 72 | array( |
| @@ -328,9 +332,9 @@ | ||
| 328 | 332 | |
| 329 | 333 | $html .= '<div id="wplng-modal-items">'; |
| 330 | 334 | |
| 331 | 335 | $html .= '<p id="wplng-modal-no-item-found" style="display: none;">'; |
| 332 | - $html .= esc_html( 'No translation found.', 'wplingua' ); | |
| 336 | + $html .= esc_html__( 'No translation found.', 'wplingua' ); | |
| 333 | 337 | $html .= '</p>'; // End #wplng-modal-no-item-found |
| 334 | 338 | |
| 335 | 339 | foreach ( $translations as $key => $translation ) { |
| 336 | 340 | |
| @@ -374,9 +378,9 @@ | ||
| 374 | 378 | $html .= ' title="' . esc_attr__( 'Edit this translation', 'wplingua' ) . '"'; |
| 375 | 379 | $html .= ' data-wplng-post="' . esc_attr( $translation['post_id'] ) . '"'; |
| 376 | 380 | $html .= ' class="wplng-button-icon wplng-edit-link"'; |
| 377 | 381 | $html .= '>'; |
| 378 | - $html .= '<span class="dashicons dashicons-edit"></span></a>'; | |
| 382 | + $html .= '<span class="dashicons dashicons-edit"></span>'; | |
| 379 | 383 | $html .= '</a>'; |
| 380 | 384 | |
| 381 | 385 | $html .= '</div>'; // End .wplng-item-edit |
| 382 | 386 | $html .= '</div>'; // End .wplng-item-main |