Panoramica del problema
Quando crei un menu e lo assegni a una posizione in AspettoMenu, aggiornando la pagina la casella di controllo della posizione viene deselezionata. Tuttavia, il menu viene comunque visualizzato correttamente sul front-end.
Questo problema si verifica quando gli ID dei termini non sono uguali agli ID della tassonomia dei termini, il che può accadere nei siti che utilizzano WordPress dalla versione 4.1 o precedenti, come spiegato qui (si apre in una nuova scheda).
Soluzione alternativa
Questo problema è stato risolto in WPML 4.6.4. L'aggiornamento risolve il problema sul tuo sito, quindi hai bisogno di questa soluzione alternativa solo se non puoi ancora aggiornare.
Assicurati di eseguire un backup completo del tuo sito prima di procedere.
- Apri …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php.
- Cerca la riga 118.
- Modifica:
In:PHP
private function maybe_warm_term_id_cache() { if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) { $data = $this->wpdb->get_results( " SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy " . $this->get_element_join() . " JOIN {$this->wpdb->terms} terms ON terms.term_id = tax.term_id WHERE tax.term_id != tax.term_taxonomy_id", ARRAY_A ); $this->term_ids = array(); $this->ttids = array(); foreach ( $data as $row ) { $this->ttids[ $row['term_id'] ] = isset( $this->ttids[ $row['term_id'] ] ) ? $this->ttids[ $row['term_id'] ] : array(); $this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = $row['element_id']; $this->term_ids[ $row['element_id'] ] = $row['term_id']; } } }
PHPprivate function maybe_warm_term_id_cache() { if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) { $data = $this->wpdb->get_results( " SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy " . $this->get_element_join() . " JOIN {$this->wpdb->terms} terms ON terms.term_id = tax.term_id WHERE tax.term_id != tax.term_taxonomy_id", ARRAY_A ); $this->term_ids = array(); $this->ttids = array(); foreach ( $data as $row ) { $this->ttids[ $row['term_id'] ] = isset( $this->ttids[ $row['term_id'] ] ) ? absint($this->ttids[ $row['term_id'] ]) : array(); $this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = absint($row['element_id']); $this->term_ids[ $row['element_id'] ] = absint($row['term_id']); } } }