ICL_LANGUAGE_CODE and polylang
-
I’ve update my themes and plugin and now i’ve some problem with ICL_LANGUAGE_CODE in functions.php.
If in functions.php i write a debug line like this one:
?>
LANGUAGE CODE:<?php var_dump(ICL_LANGUAGE_CODE); ?>
<?php
System return me correctly the language code but if i insert that constant inside a filter (see below) it doesn’t take the actual language of the website.
How can i resolve this problem?
Thank you
Vincenzoadd_filter( ‘wpcf7_validate_nazioni’, ‘custom_nazioni_validation_filter’, 10, 2 );
function custom_nazioni_validation_filter( $result, $tag ) {
global $testo_campo_obbligatorio;
$tag = new WPCF7_Shortcode( $tag );if(!isset($_POST[‘nazione’]) || $_POST[‘nazione’] == “”){
$tag->name = ‘nazioni’;
$result->invalidate( $tag, ICL_LANGUAGE_CODE );
}
return $result;
}
- The topic ‘ICL_LANGUAGE_CODE and polylang’ is closed to new replies.