Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This snippet will exclude the logged-in user's reviews from the latest reviews.
- * To make it work, add a "other-reviews" class to the Latest Reviews block or shortcode.
- *
- * @param array $values
- * @param string $method
- * @param array $args
- * @return array
- */
- add_filter('site-reviews/defaults/reviews', function ($values, $method, $args) {
- if (is_user_logged_in() && 'other-reviews' === glsr_get($args, 'class')) {
- $values['user__not_in'] = [get_current_user_id()];
- }
- return $values;
- }, 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement