- Stato
- Risolto
- Segnalato per
- WPML Multilingual CMS 4.6.12
- Risolto in
- WPML 4.7
- Plugin/tema correlato
- Divi
- Tag dell’argomento
- Compatibility
Panoramica del problema
Potresti riscontrare un problema per cui le pagine non vengono contrassegnate come tradotte dopo aver completato la traduzione al 100% utilizzando WPML con il tema Divi. Inoltre, potrebbe essere registrato il seguente errore:
PHP Fatal error: Uncaught TypeError: htmlspecialchars_decode(): Argument #1 ($string) must be of type string, array given in .../wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php:203
Soluzione alternativa
Assicurati di avere un backup completo del tuo sito prima di procedere.
- Apri il file …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-update-shortcodes-in-content.php.
- Cerca la riga 206.
- Sostituisci:
if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); } - Con:
// Ensure $translation is a string if (is_array($translation)) { // Handle array to string conversion as needed $translation = implode('', $translation); } if ( 'allow_html_tags' !== $encoding ) { $translation = htmlspecialchars( htmlspecialchars_decode( $translation ) ); }