mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed integration with WPML for Account and User pages in case if there are different permalinks for different languages for these pages;
This commit is contained in:
@@ -95,32 +95,24 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
|
|||||||
if ( isset( $user->post_name ) ) {
|
if ( isset( $user->post_name ) ) {
|
||||||
|
|
||||||
$user_slug = $user->post_name;
|
$user_slug = $user->post_name;
|
||||||
|
$newrules[ $user_slug . '/([^/]+)/?$' ] = 'index.php?page_id=' . $user_page_id . '&um_user=$matches[1]';
|
||||||
|
}
|
||||||
|
|
||||||
$add_lang_code = '';
|
if ( UM()->external_integrations()->is_wpml_active() ) {
|
||||||
$language_code = '';
|
global $sitepress;
|
||||||
|
|
||||||
if ( function_exists('icl_object_id') || function_exists('icl_get_current_language') ) {
|
$active_languages = $sitepress->get_active_languages();
|
||||||
|
|
||||||
if ( function_exists('icl_get_current_language') ) {
|
foreach ( $active_languages as $language_code => $language ) {
|
||||||
$language_code = icl_get_current_language();
|
|
||||||
} elseif( function_exists('icl_object_id') && defined('ICL_LANGUAGE_CODE') ) {
|
|
||||||
$language_code = ICL_LANGUAGE_CODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// User page translated slug
|
$lang_post_id = wpml_object_id_filter( $user_page_id, 'post', false, $language_code );
|
||||||
$lang_post_id = icl_object_id( $user->ID, 'post', FALSE, $language_code );
|
|
||||||
$lang_post_obj = get_post( $lang_post_id );
|
$lang_post_obj = get_post( $lang_post_id );
|
||||||
if( isset( $lang_post_obj->post_name ) ){
|
|
||||||
|
if ( isset( $lang_post_obj->post_name ) && $lang_post_obj->post_name != $user->post_name ) {
|
||||||
$user_slug = $lang_post_obj->post_name;
|
$user_slug = $lang_post_obj->post_name;
|
||||||
|
$newrules[ $user_slug . '/([^/]+)/?$' ] = 'index.php?page_id=' . $lang_post_id . '&um_user=$matches[1]&lang=' . $language_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $language_code != icl_get_default_language() ){
|
|
||||||
$add_lang_code = $language_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$newrules[ $user_slug.'/([^/]+)/?$' ] = 'index.php?page_id='.$user_page_id.'&um_user=$matches[1]&lang='.$add_lang_code;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,35 +124,25 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) {
|
|||||||
if ( isset( $account->post_name ) ) {
|
if ( isset( $account->post_name ) ) {
|
||||||
|
|
||||||
$account_slug = $account->post_name;
|
$account_slug = $account->post_name;
|
||||||
|
$newrules[ $account_slug . '/([^/]+)?$' ] = 'index.php?page_id=' . $account_page_id . '&um_tab=$matches[1]';
|
||||||
$add_lang_code = '';
|
|
||||||
$language_code = '';
|
|
||||||
|
|
||||||
if ( function_exists('icl_object_id') || function_exists('icl_get_current_language') ) {
|
|
||||||
|
|
||||||
if ( function_exists('icl_get_current_language') ){
|
|
||||||
$language_code = icl_get_current_language();
|
|
||||||
} elseif( function_exists('icl_object_id') && defined('ICL_LANGUAGE_CODE') ) {
|
|
||||||
$language_code = ICL_LANGUAGE_CODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Account page translated slug
|
|
||||||
$lang_post_id = icl_object_id( $account->ID, 'post', FALSE, $language_code );
|
|
||||||
$lang_post_obj = get_post( $lang_post_id );
|
|
||||||
if ( isset( $lang_post_obj->post_name ) ){
|
|
||||||
$account_slug = $lang_post_obj->post_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $language_code != icl_get_default_language() ) {
|
|
||||||
$add_lang_code = $language_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$newrules[ $account_slug.'/([^/]+)?$' ] = 'index.php?page_id='.$account_page_id.'&um_tab=$matches[1]&lang='.$add_lang_code;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( UM()->external_integrations()->is_wpml_active() ) {
|
||||||
|
global $sitepress;
|
||||||
|
|
||||||
|
$active_languages = $sitepress->get_active_languages();
|
||||||
|
|
||||||
|
foreach ( $active_languages as $language_code => $language ) {
|
||||||
|
|
||||||
|
$lang_post_id = wpml_object_id_filter( $account_page_id, 'post', false, $language_code );
|
||||||
|
$lang_post_obj = get_post( $lang_post_id );
|
||||||
|
|
||||||
|
if ( isset( $lang_post_obj->post_name ) && $lang_post_obj->post_name != $account->post_name ) {
|
||||||
|
$account_slug = $lang_post_obj->post_name;
|
||||||
|
$newrules[ $account_slug . '/([^/]+)/?$' ] = 'index.php?page_id=' . $lang_post_id . '&um_user=$matches[1]&lang=' . $language_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newrules + $rules;
|
return $newrules + $rules;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Ultimate Member\n"
|
"Project-Id-Version: Ultimate Member\n"
|
||||||
"POT-Creation-Date: 2020-01-14 15:26+0200\n"
|
"POT-Creation-Date: 2020-01-14 16:14+0200\n"
|
||||||
"PO-Revision-Date: 2020-01-14 15:26+0200\n"
|
"PO-Revision-Date: 2020-01-14 16:14+0200\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: en_US\n"
|
"Language: en_US\n"
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
|||||||
- Fixed [um_loggedin] shortcode render with htmlspecialchars_decode
|
- Fixed [um_loggedin] shortcode render with htmlspecialchars_decode
|
||||||
- Fixed checkbox options missing selections with conditional settings
|
- Fixed checkbox options missing selections with conditional settings
|
||||||
- Fixed vulnerability with uploading cover/profile photo for other user ID
|
- Fixed vulnerability with uploading cover/profile photo for other user ID
|
||||||
|
- Fixed integration with WPML for Account and User pages in case if there are different permalinks for different languages for these pages
|
||||||
- Fixed issues with pagination settings
|
- Fixed issues with pagination settings
|
||||||
- Fixed search line additional slashes
|
- Fixed search line additional slashes
|
||||||
- Fixed issues with member results JS template
|
- Fixed issues with member results JS template
|
||||||
|
|||||||
Reference in New Issue
Block a user