From 982dbd4e7f169add1d8b9d0d0bede6fae8cfcbf5 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Wed, 30 Jul 2025 12:24:10 +0300 Subject: [PATCH 1/2] - fix edit user link --- includes/frontend/class-user-profile.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/frontend/class-user-profile.php b/includes/frontend/class-user-profile.php index a2fb176e..5c08c915 100644 --- a/includes/frontend/class-user-profile.php +++ b/includes/frontend/class-user-profile.php @@ -19,6 +19,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { */ public function __construct() { add_action( 'template_redirect', array( $this, 'handle_edit_screen' ), 10000 ); + add_filter( 'get_edit_user_link', array( $this, 'get_um_edit_user_link' ), 10, 2 ); } /** @@ -30,6 +31,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { return; } + // phpcs:disable WordPress.Security.NonceVerification if ( ! isset( $_REQUEST['um_action'] ) ) { return; } @@ -44,6 +46,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { if ( isset( $_REQUEST['uid'] ) ) { $uid = absint( $_REQUEST['uid'] ); } + // phpcs:enable WordPress.Security.NonceVerification if ( ! empty( $uid ) && ! UM()->common()->users()::user_exists( $uid ) ) { return; @@ -65,5 +68,9 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { exit; } } + + public function get_um_edit_user_link( $link, $user_id ) { + return um_edit_profile_url( $user_id ); + } } } From 6905df14ea2c210d3f63236b9bc28577592a2053 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Tue, 26 Aug 2025 09:59:53 +0300 Subject: [PATCH 2/2] - fixed comment author link in commetns block --- includes/frontend/class-user-profile.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/frontend/class-user-profile.php b/includes/frontend/class-user-profile.php index 5c08c915..428450b5 100644 --- a/includes/frontend/class-user-profile.php +++ b/includes/frontend/class-user-profile.php @@ -20,6 +20,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { public function __construct() { add_action( 'template_redirect', array( $this, 'handle_edit_screen' ), 10000 ); add_filter( 'get_edit_user_link', array( $this, 'get_um_edit_user_link' ), 10, 2 ); + add_filter('get_comment_author_url', array( $this, 'get_comment_author_url' ), 10, 3); } /** @@ -72,5 +73,9 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { public function get_um_edit_user_link( $link, $user_id ) { return um_edit_profile_url( $user_id ); } + + public function get_comment_author_url( $comment_author_url, $comment_id, $comment ) { + return um_user_profile_url( $comment->user_id ); + } } }