Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Adds an "assigned_to_image" template tag
- * Paste this in your active theme's functions.php file.
- * @param \GeminiLabs\SiteReviews\Review $review
- * @param array $context
- * @return array
- */
- add_filter('site-reviews/review/build/after', function($context, $review) {
- $context['assigned_to_image'] = '';
- $postId = glsr_get($review->assigned_posts, 0);
- if (!empty($postId)) {
- $context['assigned_to_image'] = get_the_post_thumbnail($postId, 'thumbnail');
- }
- return $context;
- }, 10, 2);
Add Comment
Please, Sign In to add comment