From a2b78dd5dceb6a3e52a4078e30ce04e4899b9f3d Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Mon, 1 Feb 2016 21:10:24 +0800 Subject: [PATCH] Fix redirect loop with wpml permalink --- core/um-short-functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 90a2959c..492ea825 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -516,10 +516,12 @@ function um_profile_id() { return true; if ( isset($post->ID) && get_post_meta( $post->ID, '_um_wpml_' . $page, true ) == 1 ) return true; - if ( isset( $ultimatemember->permalinks->core[ $page ] ) - && get_post_meta( $post->ID, '_icl_lang_duplicate_of', true ) == $ultimatemember->permalinks->core[ $page ] ) + + $_icl_lang_duplicate_of = get_post_meta( $post->ID, '_icl_lang_duplicate_of', true ); + + if ( isset($post->ID) && isset( $ultimatemember->permalinks->core[ $page ] ) && ( ( $_icl_lang_duplicate_of == $ultimatemember->permalinks->core[ $page ] && ! empty( $_icl_lang_duplicate_of ) ) || $ultimatemember->permalinks->core[ $page ] == $post->ID ) ) return true; - + return false; }