Created
August 20, 2016 11:58
-
-
Save danielpowney/0c9e3bfd04c3812f4711d2e5e5c9799b 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 | |
/** | |
* Adds necessary CSS classes for full star, half star and empty star ratings. Note it does | |
* not need to actually be a star. | |
* | |
* @param unknown $icon_classes | |
* @param unknown $icon_font_library | |
* @return string | |
*/ | |
function my_add_icomoon_classes( $icon_classes, $icon_font_library ) { | |
if ( $icon_font_library == 'icomoon-faces' ) { | |
$icon_classes['star_full'] = 'icon-smile mrp-star-full'; | |
$icon_classes['star_hover'] = 'icon-smile mrp-star-hover'; | |
$icon_classes['star_half'] = 'icon-neutral mrp-star-half'; | |
$icon_classes['star_empty'] = 'icon-sad mrp-star-empty'; | |
} | |
return $icon_classes; | |
} | |
add_filter( 'mrp_icon_classes', 'my_add_icomoon_classes', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment