Proposed fix for a fatal error with Polylang
-
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
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Proposed fix for a fatal error with Polylang’ is closed to new replies.