geminilabs

Untitled

Mar 24th, 2021 (edited)
206
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // filter for a default review field tag
  2. add_filter('site-reviews/review/wrap/rating', function ($value, $rawValue, $tag) {
  3.     $formId = 25958; // change this as needed
  4.     if ($formId != $tag->args->form) {
  5.         return $value;
  6.     }
  7.     if ('rating' === $tag->with->type) {
  8.         return glsr_star_rating($rawValue);
  9.     }
  10.     return $rawValue;
  11. }, 10, 3);
  12.  
  13. // filter for a custom field tag
  14. add_filter('site-reviews/custom/wrap/kunde', function ($value, $rawValue, $tag) {
  15.     $formId = 25958; // change this as needed
  16.     if ($formId != $tag->args->form) {
  17.         return $value;
  18.     }
  19.     if ('rating' === $tag->with->type) {
  20.         return glsr_star_rating($rawValue);
  21.     }
  22.     return $rawValue;
  23. }, 10, 3);
RAW Paste Data Copied