Advertisement
geminilabs

[site-reviews] redirect if review rating is greater than 3

Mar 4th, 2020
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. /**
  2.  * Add a custom redirect if rating is greater than 3
  3.  * @param string $redirect
  4.  * @param \GeminiLabs\SiteReviews\Commands\CreateReview
  5.  * @return string
  6.  */
  7. add_filter('site-reviews/review/redirect', function ($redirect, $command) {
  8.     if ($command->rating > 3) {
  9.         return 'https://google.com/';
  10.     }
  11.     return $redirect;
  12. }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement