Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('site-reviews/validate/custom', function ($result, $request) {
- $userIds = explode(',', $request->assigned_users);
- $userIds = array_map('intval', $userIds);
- if (in_array(wp_get_current_user()->ID, $userIds)) {
- return 'You are not allowed to submit a review for yourself.';
- }
- return $result;
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement