• Resolved danielecelsa

    (@danielecelsa)


    Hello,

    in my website, people have to register and login in order to be able to leave a review.
    They become Subscriber on WordPress.

    So, is there a way to collect and show all the reviews that a user submitted? And for which post, of course?

    I would like to show them in ‘My account’ page, if there is some shortcode for this.

    I see there is something like ‘all review assigned to a user’, but I guess it is different from what I am looking for.

    Thanks in advance,
    Daniele

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

    (@geminilabs)

    If you require that only logged-in users can submit a review, then you can do this:

    [site_reviews_form assigned_users="user_id"]

    This will automatically assign the review to the logged in user.

    To display those reviews, you will probably need to add the [site_reviews] shortcode in your author or account page template using the do_shortcode function as you will probably need to pass an actual user ID. something like this:

    
    // do this in the page Loop of the author or account page:
    $userId = get_the_author_meta('ID');
    echo do_shortcode(sprintf('[site_reviews assigned_users=%s]', $userId));
    
    Thread Starter danielecelsa

    (@danielecelsa)

    Hello,

    thank you very much for your answer!

    I tried and it kind works, it show the reviews done by the user BUT it does not show the post (custom post) they are related to ??
    So I just see the reviews, but without ‘context’

    Do you think there is a way to obtain it?

    Thanks in advance!
    Daniele

    Plugin Author Gemini Labs

    (@geminilabs)

    In that case, also add the assigned_posts option to the form shortcode.

    [site_reviews_form assigned_users=user_id assigned_posts=post_id]

    Thread Starter danielecelsa

    (@danielecelsa)

    Hello,

    maybe I didn’t explain well, sorry.

    What you suggested it is what actually I am already doing:
    when a user submits a review it is in the page of a post, so I assign the review to that post (so that then I can show it in the same post page together with all the other reviews it got) and also to the user, as you suggested in your first answer. I do this through [site_reviews_form]

    But when I have to show all the review done by a user (in its account page, through [site_reviews]), I just see the ‘pure’ review, without any information about the related post where the review has been submitted.

    Is there a way to also show some information about the related posts?

    I attach screen of the code I put inside my function.php (then in the template of the posts and in the user account page, I use the shortcode widget):
    screenshot

    Thanks again!
    Daniele

    • This reply was modified 3 years, 6 months ago by danielecelsa.
    Plugin Author Gemini Labs

    (@geminilabs)

    Have you enabled displaying assigned links in the settings?

    Thread Starter danielecelsa

    (@danielecelsa)

    That’s what I was looking for ??

    But there is a way to hide those links in some [site_reviews] ?

    I mean, I want to show them in the [site_reviews] of the user account page, but I would not in the [site_reviews] of the actual page of the post, since all those reviews will have the same link which bring you in the same page..

    Hope I have been clear, if not I will send a screenshot.

    Thanks,
    Daniele

    Plugin Author Gemini Labs

    (@geminilabs)

    Please see the hide option in the Shortcodes documentation on the Help
    page.

    Thread Starter danielecelsa

    (@danielecelsa)

    Thank you! Thank you very much! ??

    Thread Starter danielecelsa

    (@danielecelsa)

    Oops sorry, actually I still have a problem..

    When I use:
    $userId = get_the_author_meta(‘ID’);

    I guess it shows all the reviews assigned to the author of the page..
    I should show the ones assigned to the current user, the one logged in that session.
    Do you maybe know how to do?

    I didn’t realize at the beginning because it worked for me ahah
    But accessing by another user, I still see my reviews

    Thanks,
    Daniele

    Thread Starter danielecelsa

    (@danielecelsa)

    Found it! Sorry for the wasted time and thanks again!!

    Plugin Author Gemini Labs

    (@geminilabs)

    In that case, use get_current_user_id()

    Thread Starter danielecelsa

    (@danielecelsa)

    Yes ?? thanks again!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to show all the reviews submitted by an user’ is closed to new replies.