Support » Plugin: Ceceppa Multilingua » get_current_lang() not working properly

  • Resolved gustavo-clicknaranja



    I’m using this to get the current language:

    global $wpCeceppaML;

    but it always returns the same! I have two languages, “en” (english) and “es” (spanish), and this function is always returning “es”. I can change the language of the page, choosing it in the languages menu, or changing the url parameters (&lang=en), and the menu changes, and everything changes, but the function I am calling from a plugin php is always returning “es”, never “en”.

    Do you know why is this happening, and how could I solve it?

    Many thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Alessandro Senese


    Try if with 1.0

    Plugin Author Alessandro Senese


    With 1.0 use this for get current language:


    This function return a php object with this fields:

    *) id – id of language
    *) cml_default – 1 if it is the default language
    *) cml_flag – name of flag
    *) cml_language – name of the language
    *) cml_language_slug – slug of the language
    *) cml_locale – wordpress locale

    Only with 1.0? I have installed 1.0.2 version…

    And I’m getting an error with cml_get_current_language();
    I call it from the theme header.php and I get this message:

    “Call to undefined function cml_get_current_language();”

    Plugin Author Alessandro Senese


    That function exists since version 1.0.0.

    You get “undefined function” because the plugin has not yet been loaded, but it is strange because I’ve added that function at the top of my “header.php” and works correctly….

    Let me know which theme you are using, so I test plugin with it…

    Plugin Author Alessandro Senese


    Have you solved the problem?

    Thank you Alessandro, you are right, the function works correctly in other places but not there, for some reason the plugin was not loaded yet.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘get_current_lang() not working properly’ is closed to new replies.