Support » Plugin: The GDPR Framework By Data443 » Privacy tools page in multilanguage site & Polylang

  • Resolved alainmelsens

    (@alainmelsens)


    Hello,
    I have the same problem as already here on the support page, see topic: https://wordpress.org/support/topic/2-language-site-2/ and it seems not solved yet for me.
    I’m busy to build a multilanguage website and I have 5 languages builded with the free version of Polylang.
    At this moment, I’m testing on local host. When I test with to Privacy Tools page, I get the good translated page but after I entered the email address, I get redirected to the page in English and not in current language.
    Please, can this issue be verified also to work with Polylang?
    I have open a new topic because it’s urgent for me.
    Thanks in advance.

    • This topic was modified 3 months, 2 weeks ago by  alainmelsens.
    • This topic was modified 3 months, 2 weeks ago by  alainmelsens.
Viewing 3 replies - 1 through 3 (of 3 total)
  • We spoke with @alainmelsens via our support channel, but wanted to circle back here on the resolution in case others needed it:

    add_filter( ‘redirect_after_gdprf_submit’,’modify_fiter’);
    function modify_fiter($value){
    $ptool_page = get_option(‘gdpr_tools_page’);
    if (isset($GLOBALS[“polylang”]))
    { $translations = $GLOBALS[“polylang”]->model->post->get_translations($ptool_page); }
    $current_language = pll_current_language();
    $default_language = pll_default_language();
    $id_ctools = $translations[$current_language];
    $modified_URL = get_site_url().’/’.$current_language.’/’.get_post_field( ‘post_name’, $id_ctools ); return $modified_URL;
    }
    add_filter( ‘privacy_tools_gdprf_page_url’,’modify_fiter_url’);
    function modify_fiter_url($value){
    $ptool_page = get_option(‘gdpr_tools_page’);
    if (isset($GLOBALS[“polylang”]))
    { $translations = $GLOBALS[“polylang”]->model->post->get_translations($ptool_page); }
    $current_language = pll_current_language();
    $default_language = pll_default_language();
    $id_ctools = $translations[$current_language];
    $modified_URL = get_site_url().’/’.$current_language.’/’.get_post_field( ‘post_name’, $id_ctools ); return $modified_URL;
    }
    ————————————————————–
    Now everything is working as expected, even for the default language.

    And thanks for the shoutout @alainmelsens :
    “Now, you may also confirm that your “The GDPR Framework” WordPress plugin is compatible with Polylang and also works with multilanguage websites. I guess this is very unique at this moment! I have tested many GDPR plugins but in fact, your “The GDPR Framework” is the only one who is GPDR compliant because it’s gives the real WORKING procedures to give the website user what he needs following the real GDPR law rules.
    Trully, it’s amazing what you give us to be GDPR compliance. I appreciate it very much.”

    We appreciate your feedback and comments!

    Hello,

    Where would the above code go?

    In function.php need to add these hooks and need to change the URL accodingly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.