- fixed logout URL with active WPML

- frontend posting integration
This commit is contained in:
nikitasinelnikov
2019-04-02 14:09:39 +03:00
parent a3fb633b5c
commit 8c1030235a
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -32,6 +32,7 @@ if ( ! class_exists( 'UM' ) ) {
* @method UM_User_Location_API User_Location_API()
* @method UM_Photos_API Photos_API()
* @method UM_Groups Groups()
* @method UM_Frontend_Posting_API Frontend_Posting_API()
*
*/
final class UM extends UM_Functions {
+6 -6
View File
@@ -45,15 +45,15 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
}
$trid = 0;
$language_code = '';
//$language_code = '';
if ( UM()->external_integrations()->is_wpml_active() ) {
global $sitepress;
$default_lang = $sitepress->get_default_language();
$language_code = $sitepress->get_current_language();
/*$language_code = $sitepress->get_current_language();
if ( $language_code == $default_lang ) {
$language_code = '';
}
}*/
$current_page_ID = get_the_ID();
if ( function_exists( 'icl_object_id' ) ) {
@@ -64,7 +64,7 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
}
$logout_page_id = UM()->config()->permalinks['logout'];
if ( um_is_core_page( 'logout' ) || ( $trid > 0 && $trid == $logout_page_id ) ) {
if ( um_is_core_page( 'logout' ) || ( $trid > 0 && $trid == $logout_page_id ) ) {
if ( is_user_logged_in() ) {
@@ -77,7 +77,7 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
} else if ( um_user('after_logout') == 'redirect_home' ) {
wp_logout();
session_unset();
exit( wp_safe_redirect( home_url( $language_code ) ) );
exit( wp_safe_redirect( home_url() ) );
} else {
/**
* UM hook
@@ -109,7 +109,7 @@ if ( ! class_exists( 'um\core\Logout' ) ) {
} else {
add_filter( 'wp_safe_redirect_fallback', array( &$this, 'safe_redirect_default' ), 10, 2 );
exit( wp_safe_redirect( home_url( $language_code ) ) );
exit( wp_safe_redirect( home_url() ) );
}
}
+1
View File
@@ -140,6 +140,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
- Email templates saving to child theme, if parent theme already has email template files
- Email templates locate in the default plugin folder with active WPML
- Form builder with some predefined form fields, which had different keys/metakeys (currently use the same)
- Logout redirect with active WPML
* Deprecated:
- "Is Account page?" and "Is User page?" options for WPML integration ( because WPML translations works properly )