hey guys, everything is in the title : how can we add polylang current language in the visibility conditions ?
i’ve found a snippet to add this to Oxygen, so i guess we can do it for cwicly too.
Here is the snippet for oxy:
if( function_exists(‘oxygen_vsb_register_condition’) && function_exists(‘pll_languages_list’) ) {
$lang_list = pll_languages_list();
oxygen_vsb_register_condition(
//Condition Name
'Locale',
//Values
array(
'options' => $lang_list,
'custom' => false
),
//Operators
array('==', '!='),
//Callback Function
'polylang_callback',
//Condition Category
'Polylang'
);
function polylang_callback($value, $operator) {
$my_lang = pll_current_language();
global $OxygenConditions;
return $OxygenConditions->eval_string($my_lang, $value, $operator);
}
}
i can see what i have to change in this snippet but i don’t know what to put instead of the oxy parts, can someone help with this ?
@Louis @Marius @StrangeTech ?