Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Restrict the title to 80 characters (client side)
- * @param array $field
- * @return array
- */
- add_filter('site-reviews/field/text', function ($field) {
- if ('title' === $field['path']) {
- $field['maxlength'] = 80;
- }
- return $field;
- });
- /**
- * Require the review to have at least 10 characters (client side)
- * @param array $field
- * @return array
- */
- add_filter('site-reviews/field/textarea', function ($field) {
- if ('content' === $field['path']) {
- $field['minlength'] = 10;
- }
- return $field;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement