Advertisement
geminilabs

[site-reviews] Limit review length to 100 characters

Oct 6th, 2018
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. /**
  2.  * Limit reviews to 100 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|max:100';
  9.     return $rules;
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement