Title: Deprecated Polylang function : $polylang-&gt;model-&gt;get_post_language()
Last modified: October 5, 2016

---

# Deprecated Polylang function : $polylang->model->get_post_language()

 *  [T-Mike](https://wordpress.org/support/users/t-mike/)
 * (@t-mike)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/deprecated-polylang-function-polylang-model-get_post_language/)
 * Hi,
 * Running a search with Polylang 2.0.5 and Relevanssi 3.5.4 activated returns this
   message from the debugger :
    `Notice: get_post_language was called incorrectly
   in C:\mysite\wp-content\plugins\relevanssi\lib\common.php on line 26: the call
   to $polylang->model->get_post_language() has been deprecated in Polylang 1.8,
   use PLL()->model->post->get_language() instead. Error handler in C:\mysite\wp-
   content\plugins\polylang\include\model.php on line 620`
 * Changing line 26 in \lib\common.php
    from `if (PLL()->model->get_post_language(
   $hit->ID)->slug == ICL_LANGUAGE_CODE) {` to `if (PLL()->model->post->get_language(
   $hit->ID)->slug == ICL_LANGUAGE_CODE) {` works fine.
 * Just thought you should know.
    (thx for the great plugin btw!)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/deprecated-polylang-function-polylang-model-get_post_language/#post-8257241)
 * Thanks, I’ll fix this in the next version.

Viewing 1 replies (of 1 total)

The topic ‘Deprecated Polylang function : $polylang->model->get_post_language()’
is closed to new replies.

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

 * 1 reply
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/deprecated-polylang-function-polylang-model-get_post_language/#post-8257241)
 * Status: not resolved