Advertisement
geminilabs

Untitled

Dec 20th, 2021
1,671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. /**
  2.  * @param string $value
  3.  * @param \GeminiLabs\SiteReviews\Modules\Html\Tags\ReviewAssignedTermsTag $tag
  4.  * @return string
  5.  */
  6. add_filter('site-reviews/review/value/assigned_terms', function ($value, $tag) {
  7.     $excludedTermIds = [1938, 1996]; // change as needed
  8.     $termIds = array_diff($tag->review->assigned_terms, $excludedTermIds);
  9.     $terms = get_terms(glsr()->taxonomy, ['include' => $termIds]);
  10.     if ($terms) {
  11.         $names = wp_list_pluck($terms, 'name');
  12.         $value = \GeminiLabs\SiteReviews\Helpers\Str::naturalJoin($names);
  13.         return $value;
  14.     }
  15.     return '';
  16. }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement