geminilabs

UM: add review count to profile page

Aug 11th, 2025 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. add_action('um_after_profile_header_name_args', function () {
  2.     if (!function_exists('glsr_get_ratings')) {
  3.         return;
  4.     }
  5.     $ratings = glsr_get_ratings([
  6.         'status' => 'approved'
  7.         'user__in' => 'profile_id',
  8.     ]);
  9.     ?>
  10.     <div class="um-profile-reviews-box">
  11.         <span class="reviews-label">No. of Reviews</span>
  12.         <span class="reviews-count"><?php echo $ratings->reviews; ?></span>
  13.     </div>
  14.     <?php
  15. });
Advertisement
Add Comment
Please, Sign In to add comment