WordPress.org

Ready to get started?Download WordPress

Forums

Widget Entries
WPML Support (3 posts)

  1. htrex
    Member
    Posted 1 year ago #

    This nice plugin uses a standard taxonomy to implement Widgets editing, so WPML is able to translate any Widget post, but adding widgets entries to sidebars only the default language is shown on the front end, the translation doesn't appear.

    http://wordpress.org/extend/plugins/widget-entries/

  2. Jorn Bakhuys
    Member
    Posted 1 year ago #

    I encountered the same problem, but solved this problem myself.
    Unfortunately this means we have to edit the plugin's code ourself, meaning that with any plugin update we have to do it all over again. Let's hope the Plugin Author will include the code in the next update.

    Change to be made:
    Go the the file
    <your-wordpress-installation>/wp-content/plugins/widget-entries/widget-include-post.php

    Change the following (rule #55):

    if(is_numeric($instance['postwidgetid'])){
    	$content = iinclude_page(intval($instance['postwidgetid']), $params, TRUE);
    }

    To:

    if(is_numeric($instance['postwidgetid'])){
    	if(function_exists('icl_object_id')) {
    		$translatedid = icl_object_id( $instance['postwidgetid'], 'pt-widget', true );
    	} else {
    		$translatedid = $instance['postwidgetid'];
    	}
    	$content = iinclude_page(intval($translatedid), $params, TRUE);
    }

    This code will check if there is a translated version of the widget in the current language. If not, it will show the widget in the default language.

  3. htrex
    Member
    Posted 1 year ago #

    Great catch jorn!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags