geminilabs

Untitled

Oct 16th, 2025
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. add_filter('site-reviews/views/data', function ($data, $view) {
  2.     if ('templates/woocommerce/reviews' !== $view) {
  3.         return $data;
  4.     }
  5.     if (!isset($data['ratings']) || !isset($data['reviews'])) {
  6.         return $data;
  7.     }
  8.     if (!empty($data['ratings']->reviews) || !is_string($data['reviews'])) {
  9.         return $data;
  10.     }
  11.     $data['reviews'] = sprintf('<div>%s%s</div>',
  12.         $data['reviews'],
  13.         apply_filters('nectar_woocommerce_no_reviews_title', '')
  14.    );
  15.     return $data;
  16. }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment