Skip to content

Instantly share code, notes, and snippets.

@bnecreative
Last active August 6, 2017 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnecreative/4bda6b734dbeef5066071b264897af18 to your computer and use it in GitHub Desktop.
Save bnecreative/4bda6b734dbeef5066071b264897af18 to your computer and use it in GitHub Desktop.
BNE Testimonials - Change Rating Field from Select to Stars
<?php
/*
* BNE Testimonials Submit Rating Field
*
* Hook into the bne_testimonials_form_fields field array and
* replace the rating select field within the front end submit form.
*
* $fields array The default field type array
* @return @fields
*
*/
add_filter('bne_testimonials_form_fields', function( $fields ) {
$fields['rating']['type'] = 'rating_star';
unset( $fields['rating']['options']['0']);
// Return all $fields
return $fields;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment