Customize the profile URL generated by the user_profile_link and user_profile_url template tags

Home / Code Snippets / Customize the profile URL generated by the user_profile_link and user_profile_url template tags

Adjust the profile URL shown in your log to suit your custom setup.

add_filter( 'mycred_users_profile_url', 'mycred_pro_adjust_user_profile_url', 10, 2 );
function mycred_pro_adjust_user_profile_url( $url, $user ) {

	// Adjust the URL
	$url = get_bloginfo( 'url' ) . '/members/' . urlencode( $user->user_login ) . '/';
	return $url;

View entire code

The above code snippet goes into your theme's functions.php file.

Last edited October 22, 2014

Leave a Reply