WPML
Stato
Risolto
Segnalato per
WPML Multilingual & Multicurrency for WooCommerce 4.0.4
Risolto in
WPML Multilingual & Multicurrency for WooCommerce 4.1.0

Panoramica del problema

Se stai utilizzando una versione precedente di WPML – ad esempio la 3.4.0, e aggiorni da WPML Multilingual & Multicurrency for WooCommerce 4.0.3 alla 4.0.4 potresti riscontrare un errore fatale simile al seguente:

"PHP Fatal error: Call to undefined method WPML_WP_API::is_comments_post_page() in /wp-content/plugins/woocommerce-multilingual/inc/wcml-switch-lang-request.php on line 136"

Soluzione alternativa

Ci sono due modi per risolvere questo problema:

1. Aggiorna WPML all’ultima versione – questo è il modo consigliato, più veloce e più sicuro.

2. Usa il seguente codice per correggere e sostituire la funzione get_requested_lang() nel file /woocommerce-multilingual/inc/wcml-switch-lang-request.php.

public function get_requested_lang() {

       return $this->is_comments_post_page() ? $this->get_cookie_lang() : $this->get_request_uri_lang();
   }

   public function is_comments_post_page() {
       global $pagenow;

       return 'wp-comments-post.php' === $pagenow;
   }

Tutti i problemi noti →