Title: ICL_LANGUAGE_CODE and polylang
Last modified: March 13, 2018

---

# ICL_LANGUAGE_CODE and polylang

 *  [Stucco81](https://wordpress.org/support/users/stucco81/)
 * (@stucco81)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/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
    Vincenzo
 * add_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.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Stucco81](https://wordpress.org/support/users/stucco81/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/icl_language_code-and-polylang/)
 * Status: not resolved