跳过导航

Waiting for author

Topic Tags: Compatibility

Overview of the issue

Currently, it is not possible to translate links within the Mega Menu widget provided by the Unlimited Elements for Elementor plugin.

Workaround

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

  • Go to WPML > Settings > Custom XML Configuration page.
  • Add the following XML:
    <wpml-config>
      <elementor-widgets>
        <widget name="ucaddon_mega_menu">
          <fields-in-item items_of="uc_items">
            <field>title</field>
            <field key_of="link">url</field>
            <field key_of="link2">url</field>
          </fields-in-item>
        </widget>
      </elementor-widgets>
    </wpml-config>
    
  • Then, open your theme’s functions.php file.
  • Add the following code:
    add_filter( 'wpml_pb_elementor_register_string_name_ucaddon_mega_menu', function( $name, $args ) {
    	$widgetType = $args['element']['widgetType'];
    	return $widgetType . '-' . $args['key'] . '-' . $args['field'] . '-' . $args['nodeId'] . '-' . $args['item']['_id'];
    }, 10, 2 );
    
  • Refresh and retranslate your page.

If this workaround doesn’t help, please open a chat in our assistance channel.

留下回复

紧扣主题并尊重他人。如果您需要帮助解决与本帖无关的问题,请使用我们的 Support Forum 开始聊天或提交票据。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>