Advertisement
geminilabs

Untitled

Oct 20th, 2023 (edited)
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. add_filter('site-reviews-notifications/notification/is-valid', function ($isValid, $notification, $review) {
  2.     $uid = 'XXXX'; // enter the notification UID here!
  3.     if ($uid !== $notification->uid) {
  4.         return $isValid;
  5.     }
  6.     $user = $review->user();
  7.     if (!$user) {
  8.         return $isValid;
  9.     }
  10.     if (!empty(get_user_meta($user->ID, '_has_coupon', true))) {
  11.         update_user_meta($user->ID, '_has_coupon', 1);
  12.         return $isValid;
  13.     }
  14.     return false;
  15. }, 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement