Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('site-reviews-notifications/notification/is-valid', function ($isValid, $notification, $review) {
- $uid = 'XXXX'; // enter the notification UID here!
- if ($uid !== $notification->uid) {
- return $isValid;
- }
- $user = $review->user();
- if (!$user) {
- return $isValid;
- }
- if (!empty(get_user_meta($user->ID, '_has_coupon', true))) {
- update_user_meta($user->ID, '_has_coupon', 1);
- return $isValid;
- }
- return false;
- }, 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement