Advertisement
geminilabs

[site-reviews] make 5 the default rating value

Nov 26th, 2019 (edited)
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. /**
  2.  * Make the rating field default to 5 stars
  3.  * @param array $fields
  4.  * @return array
  5.  */
  6. add_filter('site-reviews/config/forms/review-form', function ($fields) {
  7.     if (isset($fields['rating'])) {
  8.         $fields['rating']['value'] = 5;
  9.     }
  10.     return $fields;
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement