• Hi!
    Does anyone know how to set/delete cookie for polylang?
    My klient wants to set Latvian language as default even someone look site in Russian or English and then return.
    Polylang plugin makes cookie, but i dont need them or after some hours cookie disapear.
    I try to set up in functions.phh
    setcookie(‘wordpress_polylang’, ‘lv’, time()+3600, COOKIEPATH, COOKIE_DOMAIN, true);
    add_action(‘init’, ‘wordpress_polylang’);
    but it isn`t working
    My site https://www.piekristapa.lv

Viewing 1 replies (of 1 total)
  • You call your filter too soon. Polylang sets the cookie in ‘wp’ hook. Try this:

    add_action('wp', 'wordpress_polylang', 99);

Viewing 1 replies (of 1 total)
  • The topic ‘delete or set cookie for polylang’ is closed to new replies.