Advertisement
geminilabs

[site-reviews] Require minimum review length

Oct 5th, 2021
984
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement