mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
- small fixes for language url function;
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
Reference in New Issue
Block a user