From 8c1030235aa8020e9a7896f29435a9d812633ec7 Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Tue, 2 Apr 2019 14:09:39 +0300 Subject: [PATCH] - fixed logout URL with active WPML - frontend posting integration --- includes/class-init.php | 1 + includes/core/class-logout.php | 12 ++++++------ readme.txt | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/class-init.php b/includes/class-init.php index c9c5ee2e..556812ed 100644 --- a/includes/class-init.php +++ b/includes/class-init.php @@ -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 { diff --git a/includes/core/class-logout.php b/includes/core/class-logout.php index 27498654..c60623f4 100644 --- a/includes/core/class-logout.php +++ b/includes/core/class-logout.php @@ -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() ) ); } } diff --git a/readme.txt b/readme.txt index 3a592c07..25b1457d 100644 --- a/readme.txt +++ b/readme.txt @@ -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 )