Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('site-reviews/review/value/assigned_terms', function ($value, $tag) {
- $brand = get_term_by('slug', 'brand', glsr()->taxonomy);
- if (!$brand) {
- return $value;
- }
- $terms = $tag->review->assignedTerms();
- usort($terms, function ($a, $b) use ($brand) {
- return $a->parent !== $brand->term_id ? strcmp($a->name, $b->name) : -1;
- });
- $values = wp_list_pluck($terms, 'name');
- return !empty($values)
- ? sprintf(__('Review of %s', 'site-reviews'), \GeminiLabs\SiteReviews\Helpers\Str::naturalJoin($values))
- : '';
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement