geminilabs

Untitled

Mar 4th, 2021 (edited)
1,107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. add_filter('site-reviews/review-form/fields', function ($fields, $args) {
  2.     $fieldName = 'description'; // change this to match the field name!
  3.     $formId = glsr_get($fields, 'form.value');
  4.     $type = glsr_get($fields, $fieldName.'.type');
  5.     if (27291 == $formId && 'textarea' === $type) { // make sure we are using the relevant form
  6.         $fields = glsr_set($fields, $fieldName.'.minlength', 10); // require minimum of 10 characters
  7.     }
  8.     return $fields;
  9. }, 20, 2);
Add Comment
Please, Sign In to add comment