Advertisement
geminilabs

Untitled

Sep 6th, 2024 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. /**
  2.  * @param array $data
  3.  * @param \GeminiLabs\SiteReviews\Modules\Email $email
  4.  * @return array
  5.  */
  6. add_filter('site-reviews/email/compose', function ($data, $email) {
  7.     if (!isset($email->data['review'])) {
  8.         return $data;
  9.     }
  10.     $customFieldNames = [
  11.         'palatability',
  12.         'viscosity',
  13.         'effectiveness',
  14.         'price_quality_ratio',
  15.         'advice',
  16.     ];
  17.     foreach ($customFieldNames as $tag) {
  18.         $data['template-tags'][$tag] = $email->data['review']->custom->get($tag);
  19.     }
  20.     return $data;
  21. }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement