탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

If you are using the Events Manager plugin, you may encounter an issue where ticket details for recurring events do not display translated in secondary languages.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/events-manager/classes/em-ticket.php file.
  • Look for line 150.
  • Replace:
    function __get( $var ){
    	if( $var == 'name' || $var == 'ticket_name' || $var == 'description' || $var == 'ticket_description' ){
    		$prop = $var == 'name' || $var == 'description' ? 'ticket_'.$var : $var;
    		if( EM_ML::$is_ml && !$this->ticket_parent && !empty($this->ticket_meta['langs'][EM_ML::$current_language][$prop]) ){
    			return $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    		}else{
    			return $this->{$prop};
    		}
    	}elseif( $var == 'event' ){
    
  • With:
    function __get( $var ){
    if( $var == 'name' || $var == 'ticket_name' || $var == 'description' || $var == 'ticket_description' ){
    	$prop = $var == 'name' || $var == 'description' ? 'ticket_'.$var : $var;
    
    	// WPML Workaround for compsupp-7315
    	if ( class_exists('Sitepress') 
    		&& isset( $this->ticket_id ) 
    		&& isset( $this->event->post_id ) ) {
    
    		$string_name = 'ticket_description_'.$this->ticket_id;
    		$textdomain = 'event-tickets-'.$this->event->post_id ;
    		$this->{$prop} = apply_filters('wpml_translate_single_string', $this->{$prop} , $textdomain, $string_name);
    
    	}
    	else if ( $prop == 'ticket_name' ) {
    		$string_name = 'Ticket Name:'.substr($this->{$prop}, 0, 20);
    		$textdomain = 'events-manager' ;
    
    		if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) {
    			do_action( 'wpml_register_single_string', $textdomain, $string_name, $this->{$prop} );
    		}	
    
    		$this->{$prop} = apply_filters('wpml_translate_single_string', $this->{$prop} , $textdomain, $string_name);
    	}
    
    	if( EM_ML::$is_ml && !$this->ticket_parent && !empty($this->ticket_meta['langs'][EM_ML::$current_language][$prop]) ){
    		$check = $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    		return $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    	}else{
    		return $this->{$prop};
    	}
    }elseif( $var == 'event' ){
    
  • Visit the page with the issue in original language.
  • Go to WPML > String Translation page, search for the strings and translate them.

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>