Support » Plugin: Site Reviews » Link to User Profile

  • Resolved Danstano

    (@danstano)


    I have allowed users to submit reviews from the front-end. I want the reviewer name to link to the user profile page. How can this be achieved?

Viewing 1 replies (of 1 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    You can do this:

    add_filter('site-reviews/review/build/author', function ($field, $value, $review) {
        if ($review->user_id) {
            $authorLink = get_author_posts_url($review->user_id);
            return sprintf('<a href="%s">%s</a>', $authorLink, $value);
        }
        return $field;
    }, 10, 3);
Viewing 1 replies (of 1 total)
  • The topic ‘Link to User Profile’ is closed to new replies.