From 5668200ed380fc53c0d6e02e8b1c65f26f48ef10 Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Wed, 18 Jan 2017 21:16:26 +0800 Subject: [PATCH] Fix WPML compatibility with UM logout --- core/um-logout.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/um-logout.php b/core/um-logout.php index 8f8976e4..f1428520 100644 --- a/core/um-logout.php +++ b/core/um-logout.php @@ -35,7 +35,10 @@ class UM_Logout { } $has_translation = true; - $trid = $sitepress->get_element_trid( $current_page_ID ); + + if( function_exists('icl_object_id') ){ + $trid = $sitepress->get_element_trid( $current_page_ID ); + } if( icl_get_default_language() !== $language_code ){ $not_default_lang = true;