• Resolved Tomek Tomczuk

    (@timovega)


    Hi I have printed reviews through

    $reviews = glsr_get_reviews();
    
        foreach( $reviews as $review ) {
            echo $review
        }

    How can I hide date, review-rating span value?
    Is there a way that customer could load their own avatar through review form?
    Is there a way to create review with excerpt and on click take the customer to the full review?

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

    (@geminilabs)

    The helper function is for advanced usage. Why not use the shortcode with the hide option to hide the desired fields?

    Site Reviews uses the Gravatar service to get the avatar from the submitted email address. If you are requiring that people be logged in in order to submit a review, then you can hide the name and email fields in the form and Site Reviews will use the logged in user details, including any saved avatar.

    Reviews do not have their own permalink, however each review has a unique ID attribute that you can link to (i.e. https://website.com/#review-13). You can also enable review excerpts in the settings:

    Thread Starter Tomek Tomczuk

    (@timovega)

    I’m using reviews inside carousel and this is the reason why I have this solution

    Plugin Author Gemini Labs

    (@geminilabs)

    I just noticed that the hide option has not been added to the documentation, but you can also use it in the function like this:

    $reviews = apply_filters('glsr_get_reviews', [], [
      'display' => 10,
      'hide' => ['date','rating'],
    ]);
    if ($reviews) {
        $reviewsHtml = $reviews->build();
        printf('<div class="%s">', $reviewsHtml->style);
        foreach ($reviewsHtml as $review) {
            echo $review;
        }
        echo '</div>';
    }
    Thread Starter Tomek Tomczuk

    (@timovega)

    Thank you. That solved the problem.

    Could I use an image add-on for customer avatar? Is there an option to limit image upload to 1?

    Thread Starter Tomek Tomczuk

    (@timovega)

    I’m also wondering how can I add html element (like h4) to .glsr-review-content that will be above paragraph?

    Plugin Author Gemini Labs

    (@geminilabs)

    Could I use an image add-on for customer avatar? Is there an option to limit image upload to 1?

    Here are the options for the Images add-on:

    You can also adapt this snippet to display the uploaded image instead of the avatar (you can access the image ID array in the hook like this $tag->review->images): https://pastebin.com/rjjA3RNZ

    I’m also wondering how can I add html element (like h4) to .glsr-review-content that will be above paragraph?

    You will likely need to use a custom review.php template. Please see the Help > FAQ on how to use custom templates.

    You can also use the site-reviews/review/value/content hook to modify the value of the {{ content }} tag. See https://github.com/pryley/site-reviews/blob/master/HOOKS.md for a basic overview of all the available hooks and their parameters.

    • This reply was modified 5 years, 5 months ago by Gemini Labs.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘filer $review’ is closed to new replies.