Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Convert the author name 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\ReviewAuthorTag $tag
- * @return string
- */
- add_filter('site-reviews/review/value/author', 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement