Title: PHP Notice &#8211; lib/common.php on line 27 &#8211; deprecated in Polylang 1.8
Last modified: August 31, 2016

---

# PHP Notice – lib/common.php on line 27 – deprecated in Polylang 1.8

 *  Resolved [Jesse Graupmann](https://wordpress.org/support/users/jgraup/)
 * (@jgraup)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/)
 * **Notice**
 * > get_post_language was called incorrectly in /vagrant/site/wp-content/plugins/
   > relevanssi/lib/common.php on line 27: the call to $polylang->model->get_post_language()
   > has been deprecated in Polylang 1.8, use PLL()->model->post->get_language()
   > instead. Error handler
 * **Location**
 * > wp-content/plugins/polylang/include/model.php:543
 * **Call Stack**
 * > PLL_Model->__call()
   >  PLL_Model->get_post_language() relevanssi_wpml_filter()
   > apply_filters(‘relevanssi_hits_filter’) relevanssi_do_query() relevanssi_query()
   > apply_filters_ref_array(‘the_posts’) WP_Query->get_posts() WP_Query->query()
   > WP->query_posts() WP->main() wp()
 * [https://wordpress.org/plugins/relevanssi/](https://wordpress.org/plugins/relevanssi/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987189)
 * Thanks for the info. Does it work if you just replace
 * `$polylang->model->get_post_language`
 * with
 * `PLL()->model->post->get_language`
 * ?
 *  [primalivet](https://wordpress.org/support/users/primalivet/)
 * (@primalivet)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987323)
 * Hey Mikko,
    I tested to switch “$polylang->model->get_post_language” to “PLL()-
   >model->post->get_language” on line 27 in relevanssi/lib/common.php and the notice
   from the debugger disapered. Thanks!
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987342)
 * Thanks, this’ll be fixed in the next version.
 *  [kotpesgmail.com](https://wordpress.org/support/users/kotpesgmailcom/)
 * (@kotpesgmailcom)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987518)
 * Hey, Mikko, having same issue. Is there a quick work around (besides changing/
   lib/common.php)?
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987519)
 * This is already fixed in the current version, so the quick workaround would be
   to updating to latest version.
 *  [kotpesgmail.com](https://wordpress.org/support/users/kotpesgmailcom/)
 * (@kotpesgmailcom)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987520)
 * Hey, thanks for getting back. Still getting the error even on latest version 
   of Relevanssi:
 *     ```
       Notice: get_post_language was called incorrectly in /srv/www/site.dev/current/web/app/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 /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php on line 595
   
       Notice: get_post_language was called incorrectly in /srv/www/site.dev/current/web/app/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 /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php on line 595
   
       Warning: Cannot modify header information - headers already sent by (output started at /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php:595) in /srv/www/site.dev/current/web/wp/wp-includes/pluggable.php on line 1171
       ```
   
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987521)
 * You’re running Relevanssi 3.5.3? The line 26 of common.php in 3.5.3 is
 * `if (PLL()->model->get_post_language($hit->ID)->slug == ICL_LANGUAGE_CODE) {`
 * so I can’t see where the `$polylang->model->get_post_language()` is on that line…
 *  [kotpesgmail.com](https://wordpress.org/support/users/kotpesgmailcom/)
 * (@kotpesgmailcom)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987522)
 * Hm, I’m using composer to manage plugins, it (([https://wpackagist.org/search?q=relevanssi&type=any&search=](https://wpackagist.org/search?q=relevanssi&type=any&search=))
   actually shows 3.5.4 as latest and 3.5.3 on WordPress plugins directory.
 *  [kotpesgmail.com](https://wordpress.org/support/users/kotpesgmailcom/)
 * (@kotpesgmailcom)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987523)
 * Line 26:
    `if (PLL()->model->get_post_language($hit->ID)->slug == ICL_LANGUAGE_CODE){`
   but error still says the same. Any guesses why it is so?
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987524)
 * No idea. For starters you could start a new thread for this, as this thread is
   already marked resolved.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘PHP Notice – lib/common.php on line 27 – deprecated in Polylang 1.8’ 
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/)

## Tags

 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [notice](https://wordpress.org/support/topic-tag/notice/)

 * 10 replies
 * 4 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/php-notice-libcommonphp-on-line-27/#post-6987524)
 * Status: resolved