Last active
June 20, 2019 07:14
-
-
Save champsupertramp/514557bcbc9db45587e009b0871c94de to your computer and use it in GitHub Desktop.
Ultimate Member - SEO Yoast cannonical URL with Profile or User page URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpseo_canonical', 'um_custom_user_yoast_canonical' ); | |
function um_custom_user_yoast_canonical() { | |
if( function_exists('um_is_core_page') ){ | |
if ( um_is_core_page('user') && um_get_requested_user() ) { | |
um_fetch_user( um_get_requested_user() ); | |
return um_user_profile_url(); | |
um_reset_user(); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment