Advertisement
geminilabs

[site-reviews] Hide the title if empty

Apr 1st, 2021 (edited)
1,293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. add_filter('site-reviews/review/wrap/title', function ($value, $rawValue, $tag) {
  2.     if (empty($tag->review->title)) {
  3.         return '';
  4.     }
  5.     return $value;
  6. }, 10, 3);
  7.  
  8. // OR THIS
  9.  
  10. add_filter('site-reviews/review/value/title', function ($value) {
  11.     if ($value === __('No Title', 'site-reviews')) {
  12.         $value = '';
  13.     }
  14.     return $value;
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement