Created
October 11, 2016 22:51
-
-
Save danielpowney/2782727613778c0b9ac9124a76ee8e06 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| /** | |
| * Automatically approve ratings > 3 out 5 stars. | |
| */ | |
| function my_auto_approve_good_ratings( $auto_approve_ratings, $rating_entry ) { | |
| $rating_result = mrp_calculate_rating_entry_result( $rating_entry ); | |
| if ( $rating_result['adjusted_star_result'] > 3 ) { | |
| return true; | |
| } | |
| return false; | |
| } | |
| add_filter( 'mrp_auto_approve_ratings', 'my_auto_approve_good_ratings', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment