Advertisement
geminilabs

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

Mar 4th, 2020
291
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement