Advertisement
geminilabs

[site-reviews] change review limit number during validation

Jan 2nd, 2022 (edited)
1,462
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement