Advertisement
geminilabs

Untitled

Jul 11th, 2022
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. add_filter('site-reviews/custom/value/company_url', function ($value) {
  2.     $regex = '/(>.+<\/a>)/';
  3.     // add rel="nofollow" to links
  4.     $value = preg_replace($regex, ' rel="nofollow"$1', $value);
  5.     // change all google links
  6.     if (preg_match('/google\.com/', $value)) {
  7.         $value = preg_replace($regex, '>Google</a>', $value);
  8.     }
  9.     return $value;
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement