Advertisement
geminilabs

[site-reviews] allow links in reviews

Mar 30th, 2023 (edited)
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. /**
  2.  * It is not recommended to use this snippet!
  3.  * Allowing links in reviews will make you a target for spammers.
  4.  * It's also possible that review excerpts will break the links (since the excerpts do not take HTML tags into account)  
  5.  * Use at your own risk.
  6.  *
  7.  * @return array
  8.  */
  9. function glsr_allow_links_in_reviews(array $sanitizers) {
  10.     $sanitizers['content'] = 'text-html';
  11.     return $sanitizers;
  12. }
  13. add_filter('site-reviews/defaults/create-review/sanitize', 'glsr_allow_links_in_reviews');
  14. add_filter('site-reviews/defaults/update-review/sanitize', 'glsr_allow_links_in_reviews');
  15. add_filter('site-reviews/defaults/review/sanitize', 'glsr_allow_links_in_reviews');
  16. add_filter('site-reviews/defaults/reviews/sanitize', 'glsr_allow_links_in_reviews');
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement