Title: Check lang from within functions.php?
Last modified: August 22, 2016

---

# Check lang from within functions.php?

 *  [xhal44](https://wordpress.org/support/users/xhal44/)
 * (@xhal44)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/check-lang-from-within-functionsphp/)
 * I have extra validation functions in functions.php for Contact Form 7. I’m wondering
   if there’s a way to check which language is set from within these functions, 
   to display the error message in the correct language?
 * **Edit:** nvm, ppl_current_language works just fine, I just had to move my functions
   down to the bottom of the file.
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [xhal44](https://wordpress.org/support/users/xhal44/)
 * (@xhal44)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/check-lang-from-within-functionsphp/#post-5331506)
 * Spoke too soon. It’s not working after all it was just reading my else statement
   when lang was null.
 * Is there some documentation on how to use polylang from within a function in 
   functions.php?

Viewing 1 replies (of 1 total)

The topic ‘Check lang from within functions.php?’ 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/)

 * 1 reply
 * 1 participant
 * Last reply from: [xhal44](https://wordpress.org/support/users/xhal44/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/check-lang-from-within-functionsphp/#post-5331506)
 * Status: not resolved