Advertisement
geminilabs

[site-reviews] change review limit number during validation

Jan 2nd, 2022 (edited)
1,848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. /**
  2.  * @param bool $result
  3.  * @param \GeminiLabs\SiteReviews\Reviews $reviews
  4.  * @return bool
  5.  */
  6. function site_reviews_validate_review_limits($result, $reviews) {
  7.     $limit = 5; // Change as needed, default is 1
  8.     $result = $limit > $reviews->total;
  9.     return $result;
  10. }
  11. add_filter('site-reviews/validate/review-limits', 'site_reviews_validate_review_limits', 10, 2);
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement