Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Fixes the Star Rating control when the theme uses selectize.js to style all SELECT elements on the page
- * Note: this assumes that the theme uses jQuery with selectize.js
- * @return void
- * @see https://github.com/selectize/selectize.js
- */
- add_action('wp_footer', function () {
- echo "<script>
- jQuery(function() {
- var stars = jQuery('select.glsr-star-rating');
- if (stars) {
- stars[0].selectize.destroy();
- stars[0].value = '';
- jQuery.each(GLSR.forms, function (index, form) {
- form.initStarRatings();
- });
- }
- });
- </script>";
- }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement