geminilabs

[site-reviews] Add .browser-default to SELECT rating element

Sep 4th, 2018 (edited)
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. /**
  2.  * Site Review v5
  3.  * Add the "browser-default" class to the rating SELECT element to prevent it from being transformed by the Materialize theme
  4.  * @param array $field
  5.  * @return array
  6.  */
  7. add_filter('site-reviews/field/rating', function ($field) {
  8.     $classes = explode(' ', $field['class']);
  9.     $classes[] = 'browser-default';
  10.     $field['class'] = implode(' ', $classes);
  11.     return $field;
  12. });
Add Comment
Please, Sign In to add comment