• Resolved Emre Vona

    (@emrevona)


    Hi, I am the owner of WP Fastest Cache. I want to add a condition as below. I need to get the value of the “URL modifications” option via filter. How can I do it? Here is my temporary solution.

    $polylang_settings = get_option(“polylang”);
    if($polylang_settings[“force_lang”] == 3){
    // do something
    }


    • This topic was modified 1 year, 5 months ago by Emre Vona.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor hugod

    (@hugod)

    Hi @emrevona,
    You can use our public API to retrieve the main Polylang class instance:

    $polylang_settings = PLL()->options;
    if($polylang_settings[“force_lang”] == 3){
        // do something
    }
    Thread Starter Emre Vona

    (@emrevona)

    it does not work. I cannot use it like that. Don’t you have a filter as below?

    apply_filters(‘wpml_setting’, false, ‘language_negotiation_type’);

    • This reply was modified 1 year, 5 months ago by Emre Vona.
    Plugin Contributor hugod

    (@hugod)

    Does your code run once pll_init action is fired?
    We don’t have any filter such as wpml_setting.

    Thread Starter Emre Vona

    (@emrevona)

    Using get_option() function is better I think. thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter for URL modifications’ is closed to new replies.