• Resolved markifornia

    (@markifornia)


    Hello –

    Was curious if this plugin had customizable settings either though code or function.php file (hook) where we can redirect a user based on star rating.

    For instance a submitted star rating from 1 to 3 would redirect a user to a specific page. And then, a rating of 4 or 5 would redirect a user to an external URL – maybe to a Google review page.

    Thank you and great plugin.

    Thanks & Regards,
    Mark

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

    (@geminilabs)

    You can do something like this:

    /**
     * Redirect the page based on the review rating (Site Reviews v4)
     * @param string $redirect
     * @param \GeminiLabs\SiteReviews\Commands\SubmitReview $submission
     * @return string
     */
    add_filter('site-reviews/review/redirect', function ($redirect, $submission) {
        if (!empty($redirect)) {
            return $redirect;
        }
        if ($submission->rating > 3) {
            return 'https://google.com/page/url/here';
        }
        return home_url('how/can/we/do/better');
    }, 10, 2);
    Thread Starter markifornia

    (@markifornia)

    Thank You Gemini Labs. ??

    That feature/solution is EXACTLY what I’m looking for.

    Keep immersing and building cool new features and projects!

    Cheers
    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect User based on Review Rating’ is closed to new replies.