Advertisement
geminilabs

Untitled

Nov 23rd, 2024 (edited)
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. /**
  2.  * @param \GeminiLabs\SiteReviews\Modules\Html\Tags\Tag $tag
  3.  * @return string
  4.  */
  5. add_filter('site-reviews/review/value/author', function (string $name, $tag) {
  6.     $user = $tag->review->user()
  7.     if (empty($user)) {
  8.         return $value;
  9.     }
  10.     if (!function_exists('um_user_profile_url')) {
  11.         return $value;
  12.     }
  13.     if ($url = um_user_profile_url($user->ID)) {
  14.         return sprintf('<a href="%s">%s</a>', $url, $value);
  15.     }
  16.     return $value;
  17. }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement