From 2e95891c3c58d1e616e5328d15b601dbd31525aa Mon Sep 17 00:00:00 2001 From: dbaranov Date: Tue, 30 Nov 2021 23:12:36 +0200 Subject: [PATCH] - fixed canonical link in profile translated with WPML --- includes/core/um-filters-profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core/um-filters-profile.php b/includes/core/um-filters-profile.php index 94a30568..4b7b6eb2 100644 --- a/includes/core/um-filters-profile.php +++ b/includes/core/um-filters-profile.php @@ -79,7 +79,7 @@ add_filter( 'the_title', 'um_dynamic_user_profile_title', 100000, 2 ); * @return string|false The canonical URL, or false if current URL is canonical. */ function um_get_canonical_url( $canonical_url, $post ) { - if ( UM()->config()->permalinks['user'] == $post->ID ) { + if ( UM()->config()->permalinks['user'] == $post->ID || (UM()->external_integrations()->is_wpml_active() && UM()->config()->permalinks['user'] == wpml_object_id_filter( $post->ID, 'page', true, icl_get_default_language() )) ) { /** * UM hook