mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 06:33:50 +09:00
@@ -585,14 +585,21 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get a translated core page URL
|
||||
***/
|
||||
|
||||
/**
|
||||
* Get a translated core page URL
|
||||
*
|
||||
* @param $post_id
|
||||
* @param $language
|
||||
* @return bool|false|string
|
||||
*/
|
||||
function um_get_url_for_language( $post_id, $language ) {
|
||||
if ( ! um_is_wpml_active() )
|
||||
return '';
|
||||
|
||||
$lang_post_id = icl_object_id( $post_id, 'page', true, $language );
|
||||
|
||||
$url = "";
|
||||
if ($lang_post_id != 0) {
|
||||
if ( $lang_post_id != 0 ) {
|
||||
$url = get_permalink( $lang_post_id );
|
||||
} else {
|
||||
// No page found, it's most likely the homepage
|
||||
@@ -603,6 +610,22 @@
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if WPML is active
|
||||
*
|
||||
* @return bool|mixed
|
||||
*/
|
||||
function um_is_wpml_active() {
|
||||
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
||||
global $sitepress;
|
||||
|
||||
return $sitepress->get_setting( 'setup_complete' );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get core page url
|
||||
***/
|
||||
|
||||
Reference in New Issue
Block a user