From 2874e9227029bb720c99b770f36684e338c4304a Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 9 Dec 2015 10:53:13 +0800 Subject: [PATCH] Enable WPML support to all UM url/links --- core/um-short-functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 662496d3..4716ffa1 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -424,7 +424,10 @@ function um_profile_id() { $url = add_query_arg( 'updated', esc_attr( $updated ), $url ); } - if ( function_exists('icl_get_current_language') && icl_get_current_language() != icl_get_default_language() && $slug == 'account' ) { + if ( function_exists('icl_get_current_language') && icl_get_current_language() != icl_get_default_language() ) { + + $url = um_get_url_for_language( $ultimatemember->permalinks->core[ $slug ], icl_get_current_language() ); + if ( get_post_meta( get_the_ID() , '_um_wpml_account', true ) == 1 ) { $url = get_permalink( get_the_ID() ); }