Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This code snippet prevents the Review Authors addon from removing the
- * name and email from a review when it is edited on the frontend with a
- * custom Review Form that does not include the name and email fields.
- *
- * This code snippet can safely be removed from the website after
- * the Review Authors addon has been updated to v2.0.0 or higher.
- */
- add_filter('site-reviews-authors/update/review-values', function ($values, $update) {
- $review = glsr_get_review($update->request->review_id);
- foreach ($values as $key => $value) {
- if (!$update->request->exists($key)) {
- $values[$key] = $review->offsetGet($key);
- }
- }
- return $values;
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment