Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add the Accepted Terms data to the review
- *
- * @param array $data
- * @param \GeminiLabs\SiteReviews\Review $review
- * @return array
- */
- add_filter('site-reviews/personal-data/export', function ($data, $review) {
- $name = 'Terms Accepted';
- if (false !== array_search($name, wp_list_pluck($data, 'name'))) {
- // The Accepted Terms date has already been added to the export
- return $data;
- }
- // If the terms were accepted when the review was submitted, use the review creation date as the value
- $value = $review->terms ? $review->date_gmt : false;
- // Set the Accepted Terms date to the export data
- $data[] = ['name' => $name, 'value' => $value];
- return $data;
- }, 10, 2);
Add Comment
Please, Sign In to add comment