Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Convert the avatar to an author link (if the author is an existing user)
- * Paste this in your active theme's functions.php file.
- * @param string $value
- * @param \GeminiLabs\SiteReviews\Modules\Html\Tags\ReviewAvatarTag $tag
- * @return string
- */
- add_filter('site-reviews/review/value/avatar', function ($value, $tag) {
- if ($user = get_userdata($tag->review->author_id)) {
- $authorUrl = get_author_posts_url($user->ID);
- return sprintf('<a href="%s">%s</a>', $authorUrl, $value);
- }
- return $value;
- }, 10, 2);
Add Comment
Please, Sign In to add comment