WPML
상태
개발자가 해결함
해결된 버전
JetSearch 3.2.0
관련 플러그인/테마
JetSearch
주제 태그
Compatibility

문제 개요

WPMLJetSearch 플러그인을 함께 사용할 때, 사용자가 다른 언어로 전환하여 해당 언어로 글을 검색하더라도 검색 결과 미리보기 영역에는 기본 언어로 된 글만 표시됩니다.

임시 해결 방법

진행하기 전에 사이트의 전체 백업을 완료했는지 확인하세요.


  • 먼저 …/wp-content/plugins/jet-search/includes/ajax-handlers.php 파일을 여세요.

  • 61번째 줄을 찾으세요.

  • 그 바로 아래에 다음을 추가하세요:
    			//WPML workaround for compsupp-6886 - Part I
    			if ( isset( $_GET[ 'wpml_lang' ] ) ) {
    				do_action( 'wpml_switch_language',  $_GET[ 'wpml_lang' ] ); // switch the content language
    			}

  • 두 번째로, …/wp-content/plugins/jet-search/includes/assets.php 파일을 여세요:

  • 151번째 줄을 찾으세요.

  • 이 줄 바로 아래에:
    				$this->localize_data['rest_api_url']  = get_site_url() . "/wp-json/jet-search/v1/search-posts";
  • 다음을 추가하세요:
    				//WPML workaround for compsupp-6886 - Part II
    				$wpml_current_lang = apply_filters( 'wpml_current_language', NULL ); 
    				if ( $wpml_current_lang ) {
    					$this->localize_data['rest_api_url'] = add_query_arg( 'wpml_lang', $wpml_current_lang, $this->localize_data['rest_api_url'] );
    				}	

알려진 모든 문제 →