From 70bd8050ba77f3a61c9df12c0fc1f1e69b657da0 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Wed, 6 Nov 2024 18:15:34 +0000 Subject: [PATCH] Use the `user_has_vip_support_role` method to check if the user is a support user. (#5965) Co-authored-by: Rinat K --- vip-parsely/vip-parsely.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vip-parsely/vip-parsely.php b/vip-parsely/vip-parsely.php index 45c36324a7..de6ae4dd91 100644 --- a/vip-parsely/vip-parsely.php +++ b/vip-parsely/vip-parsely.php @@ -16,6 +16,7 @@ use Automattic\VIP\Parsely\Telemetry\Telemetry; use Automattic\VIP\Parsely\Telemetry\Tracks; +use Automattic\VIP\Support_User\User as Support_User; /** * This is determined by our value passed to the `WP_Widget` constructor. @@ -89,7 +90,7 @@ function (): void { add_filter( 'wp_parsely_current_user_can_use_pch_feature', function ( $current_user_can_use_pch_feature, $feature_name, $current_user ) { $user_id = $current_user->ID; - if ( user_can( $user_id, 'vip_support' ) ) { + if ( Support_User::user_has_vip_support_role( $user_id ) ) { return true; }