From a33be50a5584d1e23056111afac31afa606831ab Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Tue, 7 Oct 2025 11:56:25 +0300 Subject: [PATCH] Fix user profile URL logic for comment authors Previously, the profile URL was returned even when the user ID was empty. This change ensures the URL is only generated if the user ID is present, preventing potential errors. --- includes/frontend/class-user-profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/frontend/class-user-profile.php b/includes/frontend/class-user-profile.php index b1b1381a..14a0fca5 100644 --- a/includes/frontend/class-user-profile.php +++ b/includes/frontend/class-user-profile.php @@ -94,7 +94,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { * @return string The user profile URL for the comment author. */ public function change_comment_author_url( $comment_author_url, $comment_id, $comment ) { - if ( ! is_null( $comment ) ) { + if ( ! is_null( $comment ) && ! empty( $comment->user_id ) ) { return um_user_profile_url( $comment->user_id ); }