From b6138eb665e289ef7372a689631b4959e65efd37 Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Fri, 15 Nov 2019 21:43:29 +0800 Subject: [PATCH] Fix fatal error - check if wpml is active --- includes/core/class-external-integrations.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/core/class-external-integrations.php b/includes/core/class-external-integrations.php index 95da7c6f..0ee43631 100644 --- a/includes/core/class-external-integrations.php +++ b/includes/core/class-external-integrations.php @@ -269,6 +269,11 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) { function get_languages_codes( $current_code = false ) { global $sitepress; + if( ! function_exists('wpml_object_id ') ) return array( + 'default' => '', + 'current' => $current + ); + $current_code = ! empty( $current_code ) ? $current_code : $sitepress->get_current_language(); $default = $sitepress->get_locale_from_language_code( $sitepress->get_default_language() );