Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('site-reviews/review/value/title', function ($value, $tag) {
- if (!empty($tag->review->title)) {
- return $value;
- }
- $post = $tag->review->assignedPosts()[0] ?? null;
- if (empty($post)) {
- return '';
- }
- $parts = array_filter([
- get_the_title($post),
- get_the_author_meta('display_name', $post->post_author),
- ]);
- $title = implode(' - ', $parts);
- return trim($title);
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment