WPML

Tổng quan về sự cố

Giao diện Houzez sử dụng hàm tùy chỉnh riêng để gọi các tùy chọn giao diện. Nếu ngôn ngữ mặc định của trang web không phải là tiếng Anh, hàm này sẽ xung đột với WPML. Kết quả là các bản dịch sẽ không được hiển thị ở giao diện người dùng và chúng sẽ bị chuyển về ngôn ngữ mặc định trong trang quản trị.

Giải pháp tạm thời

Sự cố này đã được khắc phục. Việc cập nhật lên phiên bản mới nhất giải quyết vấn đề này trên trang web của bạn, vì vậy bạn chỉ cần giải pháp tạm thời này nếu chưa thể cập nhật.

Trước khi tiếp tục, hãy sao lưu toàn bộ trang web của bạn.

  1. Mở /wpml-string-translation/inc/admin-texts/wpml-admin-texts.class.php.
  2. Tìm dòng 198.
  3. Thay thế:
    function icl_st_set_admin_options_filters() {
    	$option_names = $this->getOptionNames();
    
    	foreach ( $option_names as $option_key => $option ) {
    		if ( $this->is_blacklisted( $option_key ) ) {
    			unset( $option_names[ $option_key ] );
    			update_option( '_icl_admin_option_names', $option_names );
    		} elseif ( $option_key != 'theme' && $option_key != 'plugin' ) { // theme and plugin are an obsolete format before 3.2
    			add_filter( 'option_' . $option_key, array( $this, 'icl_st_translate_admin_string' ) );
    			add_action( 'update_option_' . $option_key, array( $this, 'on_update_original_value' ), 10, 3 );
    		}
    	}
    }
  4. Bằng:
    function icl_st_set_admin_options_filters() {
    	$option_names = $this->getOptionNames();
    
    	$isAdmin = is_admin() && ! wpml_is_ajax();
    
    	foreach ( $option_names as $option_key => $option ) {
    		if ( $this->is_blacklisted( $option_key ) ) {
    			unset( $option_names[ $option_key ] );
    			update_option( '_icl_admin_option_names', $option_names );
    		} elseif ( $option_key != 'theme' && $option_key != 'plugin' ) { // theme and plugin are an obsolete format before 3.2
    			/**
    			 * We don't want to translate admin strings in admin panel because it causes a lot of confusion
    			 * when a value is displayed inside the form input.
    			 **/
    			if ( ! $isAdmin ) {
    				add_filter( 'option_' . $option_key, array( $this, 'icl_st_translate_admin_string' ) );
    			}
    			add_action( 'update_option_' . $option_key, array( $this, 'on_update_original_value' ), 10, 3 );
    		}
    	}
    }

Các bước tiếp theo

Sự cố này sẽ được giải quyết trong phiên bản phát hành WPML 4.5 (cuối tháng 9 năm 2021).

Tất cả lỗi đã ghi nhận

Vẫn gặp sự cố này?

Nếu việc cập nhật không khắc phục được, hãy đặt một câu hỏi hỗ trợ và chúng tôi sẽ cùng bạn xem xét.