Advertisement
geminilabs

[site-reviews] Add .dynamic_control to SELECT rating element

Mar 2nd, 2020
267
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Adds the "dynamic_control" class to the rating SELECT element to prevent it from being transformed by the jQuery Uniform library
  3.  * Paste this in your active theme's functions.php file.
  4.  * @param string $rendered
  5.  * @param string $type
  6.  * @return string
  7.  */
  8. add_filter('site-reviews/rendered/field', function ($rendered, $type) {
  9.     if (!is_admin() && $type == 'select') {
  10.         $rendered = str_replace('glsr-star-rating', 'glsr-star-rating dynamic_control', $rendered);
  11.     }
  12.     return $rendered;
  13. }, 10, 2);
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement