Saltar navegación

Resolved by author

Topic Tags: Compatibility

Overview of the issue

Within the Uncode theme, when using the Posts (uncode_index) shortcode, two issues have been identified:

  • Unexpected base64 encoded content is send to our Advanced Translation Editor.
  • Inability to translate the «Read More» text within the Posts shortcode.

Workaround

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

You need to apply 2 fixes:

Part I

  • Go to WPML > Configuration > Custom XML Configuration page.
  • Add the following XML:
    1
    2
    3
    4
    5
    6
    7
    <wpml-config>
      <shortcodes>
        <shortcode>
          <tag>uncode_index</tag>
        </shortcode>
      </shortcodes>
    </wpml-config>

Part II

  • Open …/wp-content/themes/uncode/vc_templates/uncode_index.php file.
  • Look for line 2558.
  • Replace:
    1
    2
    3
    if (isset($item_prop['read_more_text'])) {
        $block_data['read_more_text'] = $item_prop['read_more_text'];
    }
  • With:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    if (isset($item_prop['read_more_text'])) {
        $block_data['read_more_text'] = $item_prop['read_more_text'];
     
        // WPML Workaround for compsupp-7136
        if ( class_exists('Sitepress') ) {
            $string = $block_data['read_more_text'];
            $textdomain = 'WordPress';
            $string_name = 'WPML Workaround : '.substr($string, 0, 20);
     
            $wpml_default_lang = apply_filters('wpml_default_language', NULL );
            $wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
     
            if ($wpml_default_lang == $wpml_current_lang ) {
                do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
            }  
            // Apply the translation to the string
            $block_data['read_more_text'] = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
        }
    }

Deje una respuesta

Por favor, mantente dentro del tema y sé respetuoso con los demás. Si necesitas ayuda con cuestiones no relacionadas con este post, utiliza nuestro Foro de soporte para iniciar un chat o enviar un ticket.

Puede utilizar estas etiquetas:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>