Advertisement
geminilabs

[site-reviews] fix rating fields when theme uses select2.js

Jan 24th, 2024 (edited)
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. /*
  2.  * Fixes Star Rating fields when the theme uses select2.js to style all <select> elements on the page
  3.  * Note: This snippet assumes that the theme uses jQuery with select2.js
  4.  * @see https://github.com/select2/select2
  5.  */
  6. add_action('wp_footer', function () {
  7.     echo '<script>jQuery(function($){setTimeout(function(){$(".glsr-star-rating select.select2-hidden-accessible").select2("destroy")},100)});</script>';
  8. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement