- small fixes for language url function;

This commit is contained in:
nikitozzzzzzz
2018-02-19 00:22:34 +02:00
parent f81ef312a4
commit f4d1251220
4 changed files with 78 additions and 86 deletions
+1 -14
View File
@@ -349,18 +349,5 @@ function um_core_is_local() {
*/
function um_get_url_for_language( $post_id, $language ) {
//um_deprecated_function( 'um_get_url_for_language', '2.0', 'UM()->external_integrations()->get_url_for_language' );
if ( ! UM()->external_integrations()->is_wpml_active() )
return '';
$lang_post_id = icl_object_id( $post_id, 'page', true, $language );
if ( $lang_post_id != 0 ) {
$url = get_permalink( $lang_post_id );
} else {
// No page found, it's most likely the homepage
global $sitepress;
$url = $sitepress->language_url( $language );
}
return $url;
return UM()->external_integrations()->get_url_for_language( $post_id, $language );
}