Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: Relevanssi - A Better Search] Proposed fix for a fatal error with Polylang"

$
0
0

Hi Mikko Saari,

A user reported a fatal error at line 15 in inc/common.php when using both Relevanssi and Polylang.

Here is the line:

if (function_exists('icl_object_id') && $sitepress->is_translated_post_type($hit->post_type)) {

Polylang defines the function 'icl_object_id' as part of the WPML API compatibility but does not define the $sitepress object. So either you can modify the line to

if (function_exists('icl_object_id') && !function_exists('pll_is_translated_post_type') && $sitepress->is_translated_post_type($hit->post_type)) {

or even easier, just make this test after the next one (so Polylang before WPML)

Frédéric

https://wordpress.org/plugins/relevanssi/


Viewing all articles
Browse latest Browse all 11471


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>