Support » Plugin: Restrict Widgets » Problems with WPML

  • Philipp Kühn


    I have problems with WPML and multiple languages. I don’t know how it is supposed to work. But THE MOST times, there are only listed the pages, categories etc from my DEFAULT language. But sometimes and I don’t know why, there are listed the items from my other languages. I found no system behind that…

    The problem here is, if that there are listed the items of my default language and I open my page in another language the filter do not work. I think it would make sense, that the standard item should displayed always . But then the filter sometimes not work.

    I fixed that for me with replacing this:

    $post_id = $wp_query->get_queried_object_id();

    with this:

    $post_id = $wp_query->get_queried_object_id();
    if (function_exists('icl_object_id')) {
    	global $sitepress;
    	$post_id = icl_object_id($post_id, 'page', TRUE, $sitepress->get_default_language());

    How should it actually work?

Viewing 1 replies (of 1 total)
  • Plugin Author dFactory


    Thank you Phillip,

    We noticed similar behavior but it was try to find out when it occurs. Your code forces displaying elements in default site language and I think it should solve the problem – we’ll add in the upcoming release of the plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘Problems with WPML’ is closed to new replies.