Advertisement
geminilabs

[site-reviews] make 5 the default rating value

Nov 26th, 2019 (edited)
534
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement