PluginProbe
Translate and boost SEO – Automatic AI translation – wpLingua / 2.16.8
Translate and boost SEO – Automatic AI translation – wpLingua v2.16.8
2.16.8 2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 All 113 releases
← All changes | inc/dom/replace-body-class.php +3 -3 2.12.22.16.8 View file →
@@ -6,9 +6,9 @@
6 6 }
7 7
8 8
9 9 /**
10 - * Modify the ody class in dom for translated pages
10 + * Modify the body class in dom for translated pages
11 11 *
12 12 * @param object $dom
13 13 * @param array $args
14 14 * @return object
@@ -17,11 +17,11 @@
17 17
18 18 wplng_args_setup( $args );
19 19
20 20 // Replace languages IDs in <body> class
21 - foreach ( $dom->find( 'body[class]' ) as $element ) {
21 + foreach ( $dom->find( 'body' ) as $element ) {
22 22
23 - $class_array = explode( ' ', $element->class );
23 + $class_array = ! empty( $element->class ) ? explode( ' ', $element->class ) : array();
24 24
25 25 foreach ( $class_array as $key => $class ) {
26 26 if ( wplng_str_is_locale_id( $class ) ) {
27 27 $class_array[ $key ] = $args['language_target'];