Advertisement
geminilabs

[site-reviews] Require minimum review length

Oct 5th, 2021
1,416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. /**
  2.  * Require that reviews have a minimum of 20 characters (change the number to your desired length)
  3.  * Paste this in your active theme's functions.php file.
  4.  * @param array $rules
  5.  * @return array
  6.  */
  7. add_filter('site-reviews/validation/rules', function ($rules) {
  8.     $rules['content'] = 'required|min:20';
  9.     return $rules;
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement