geminilabs

Untitled

Mar 4th, 2021 (edited)
770
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data