Advertisement
geminilabs

[site-reviews] [ultimate-member] Display link to user profile in review

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