Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-user-manager/5b126afcc628a6cbd7893631f6931987 to your computer and use it in GitHub Desktop.
Save wp-user-manager/5b126afcc628a6cbd7893631f6931987 to your computer and use it in GitHub Desktop.
WP User Manager - Make the comment author URL the user's profile URL
<?php
add_filter( 'get_comment_author_url', function ( $url, $id, $comment ) {
if ( $comment->user_id == 0 ) {
// Comment left by guest
return $url;
}
$user = get_user_by( 'id', $comment->user_id );
return wpum_get_profile_url( $user );
}, 10, 3 );
@wp-user-manager
Copy link
Author

Save this file to your /wp-content/mu-plugins/ directory (you might need to create the mu-plugins directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment