Advertisement
geminilabs

[site-reviews] make the submission form start with 5-stars

Dec 2nd, 2018
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. /**
  2.  * Makes the star-rating control in the submission form start with 5-stars
  3.  * Site Reviews v3.0 only!
  4.  * Paste this in your active theme's functions.php file.
  5.  * @param array $fields
  6.  * @return array
  7.  */
  8. add_filter( 'site-reviews/config/forms/submission-form', function( $fields ) {
  9.     if( isset( $fields['rating'] )) {
  10.         $fields['rating']['value'] = 5;
  11.     }
  12.     return $fields;
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement