Advertisement
geminilabs

[site-reviews] display the author name in the review title

Jul 8th, 2020
1,197
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Change the displayed review title to use the review author name
  3.  *
  4.  * @param string $value
  5.  * @param \GeminiLabs\SiteReviews\Review $review
  6.  * @return string
  7.  */
  8. add_filter('site-reviews/review/wrap/title', function ($value, $review) {
  9.     if (!empty($review->author)) {
  10.         $value = sprintf('<h3>%s recommends this.</h3>', $review->author);
  11.     }
  12.     return $value;
  13. }, 10, 2);
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement