mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 14:43:49 +09:00
WPML compatibility
This commit is contained in:
@@ -151,6 +151,24 @@ class UM_Permalinks {
|
||||
}
|
||||
}
|
||||
|
||||
// WPML compatibility
|
||||
if ( function_exists('icl_object_id') ) {
|
||||
|
||||
|
||||
$language_code = ICL_LANGUAGE_CODE;
|
||||
$lang_post_id = icl_object_id( $page_id , 'page', true, $language_code );
|
||||
|
||||
if($lang_post_id != 0) {
|
||||
$profile_url = get_permalink( $lang_post_id );
|
||||
}else {
|
||||
// No page found, it's most likely the homepage
|
||||
global $sitepress;
|
||||
$profile_url = $sitepress->language_url( $language );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( um_get_option('permalink_base') == 'user_login' ) {
|
||||
$user_in_url = um_user('user_login');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user