문제 개요
외모메뉴에서 메뉴를 생성하고 위치에 할당한 후 페이지를 새로 고침하면 위치 확인란의 선택이 해제됩니다. 하지만 프런트엔드에서는 메뉴가 여전히 올바르게 표시됩니다.
이 문제는 용어 ID가 용어 택소노미 ID와 같지 않을 때 발생하며, 여기 (새 탭에서 열림)에 설명된 대로 버전 4.1 이하부터 WordPress를 실행 중인 사이트에서 발생할 수 있습니다.
임시 해결 방법
이 문제는 WPML 4.6.4에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.
진행하기 전에 반드시 사이트의 전체 백업을 수행하세요.
- …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php 파일을 여세요.
- 118번 줄을 찾으세요.
- 다음을:
다음으로 변경하세요: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']); } } }