Fix fatal error - check if wpml is active

This commit is contained in:
Champ Camba
2019-11-15 21:43:29 +08:00
parent 5e126d9437
commit b6138eb665
@@ -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() );