Last active
August 6, 2017 23:44
-
-
Save bnecreative/4bda6b734dbeef5066071b264897af18 to your computer and use it in GitHub Desktop.
BNE Testimonials - Change Rating Field from Select to Stars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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