Advertisement
geminilabs

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

Jul 8th, 2020
1,356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement