• Hi there,

    I’ve tried to use the pll_current_language in a count-down plugin.

    But I got the message :
    Fatal error: Call to undefined function pll_current_language().

    Any idea.

    Thx for your help.

    Catherine.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter catheg

    (@catheg)

    Other thing, when I use get_locale(), the lamguage code returned doesn’t change even when I switch language.
    The language code returned is the language defined in the general settings of wordpress.

    Plugin Author Chouby

    (@chouby)

    Hi,

    You are attempting to use the current language before it is defined. See https://polylang.pro/doc/developpers-how-to/ to know when the current language is defined depending on the options.

    Thread Starter catheg

    (@catheg)

    I’m in the case 2.

    My language settings, URL modifications is the following :
    The language is set from the directory name in pretty permalinks

    So the language is supposed to be defined.

    Plugin Author Chouby

    (@chouby)

    Not if you are attempting to use pll_current_language() before the action plugins_loaded id fired.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pll_current_language fatal error’ is closed to new replies.