Plugin Author
Chouby
(@chouby)
Hi!
Could you check if you have a default language in the Languages list table? It should be marked with a star.
Thread Starter
olidac
(@olidac)
function pll_default_language( $field = 'slug' ) {
return ( $lang = PLL()->model->get_language( PLL()->options['default_lang'] ) ) && isset( $lang->$field ) ? $lang->$field : false;
}
It is necessary to check existence of the value :
isset(PLL()->options['default_lang'])
I need the plugin to work without a default lang.
Plugin Author
Chouby
(@chouby)
Unless you delete it (and you need to code to do that), Polylang has *always* a default language (otherwise some features wouldn’t correctly work). That’s why I don’t need to check it. And nobody should expect pll_default_language() to return false.
If you succeeded to suppress the default language, why are you calling pll_default_language()?