Merge pull request #948 from ultimatemember/fix/canonical_link_in_wpml_profile

Canonical link in translated profile
This commit is contained in:
Nikita Sinelnikov
2021-12-10 15:12:31 +02:00
committed by GitHub
+1 -1
View File
@@ -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