탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

If you are using the RSVP Pro plugin, you may encounter issues where some strings do not display as translated on the frontend when using WPML. This problem typically arises due to the string’s unique key exceeding the character limit set by the system, resulting in mismatched keys and untranslated strings.

Workaround

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

  • Open the app/public/wp-content/plugins/rsvp-pro-plugin/includes/rsvp-utils.inc.php file
  • Look for line 1069.
  • Replace:
    function rsvp_pro_get_dynamic_translated_string( $key_name, $string, $event_id ) {
    	$text = $string;
    
    	if ( function_exists( 'pll__' ) ) {
    		$text = pll__( $string );
    	}
    
    	if ( has_filter( 'wpml_translate_string' ) ) {
    		$event_name = rsvp_pro_get_event_name( $event_id );
    		$package    = array(
    			'kind'  => "RSVPPro - {$event_id}",
    			'name'  => "rsvp-pro-plugin-{$event_id}",
    			'title' => "RSVP Pro Plugin - {$event_name}",
    		);
    		$key_name   = strtolower( $key_name );
    		$key_name   = str_replace( ' ', '-', $key_name );
    		$text       = apply_filters( 'wpml_translate_string', $string, $key_name, $package );
    	}
    
    	return $text;
    }
    
  • With:
    function rsvp_pro_get_dynamic_translated_string( $key_name, $string, $event_id ) {
    	$text = $string;
    
    	if ( function_exists( 'pll__' ) ) {
    		$text = pll__( $string );
    	}
    
    	if ( has_filter( 'wpml_translate_string' ) ) {
    		$event_name = rsvp_pro_get_event_name( $event_id );
    		$package    = array(
    			'kind'  => "RSVPPro - {$event_id}",
    			'name'  => "rsvp-pro-plugin-{$event_id}",
    			'title' => "RSVP Pro Plugin - {$event_name}",
    		);
    		$key_name   = strtolower( $key_name );
    		$key_name   = str_replace( ' ', '-', $key_name );
    
    		// WPML Workaround for compsupp-7503
    		$key_name = substr($key_name, 0, 160);
    		
    		$text       = apply_filters( 'wpml_translate_string', $string, $key_name, $package );
    	}
    
    	return $text;
    }
    

답장을 남겨주세요

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

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