• Resolved bostondv

    (@bostondv)


    I am unable to get the “pll_get_flag” function to work.

    I’ve been testing with the example provided in the documentation and tried various priorities and calling the filter in functions.php or within hooks such as “after_theme_setup” and “init” to no avail.

    add_filter('pll_get_flag', 'no_flag_on_admin');
    function no_flag_on_admin($flag) {
      return is_admin() ? '' : $flag;
    }

    My hunch is the flags are getting set before any theme functions have the opportunity to run, but I’m not sure. I’m running 1.6.4.

    Thanks

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    Yes. That’s the problem. create a new directory ‘polylang’ in wp-content, then create a new file ‘pll-config.php’ in this directory. Then put your code inside this file. This will be loaded by Polylang and avoids you to create a new plugin.

    Thread Starter bostondv

    (@bostondv)

    Perfect, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘pll_get_flag filter does not work’ is closed to new replies.