Notifications
Clear all

Problem with censure pro links

11 Posts
2 Users
3 Reactions
4,248 Views
Astghik
Posts: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi Mariosgr,

This code should hepl you. Please add it in your current active them's functions.php file.

add_filter('wpforo_content_after', function ($content) {
$s = array('gvectors.com');
$r = array('gvectors.net');
return str_replace($s, $r, $content);
}, 999);

 

Reply
Posts: 230
Customer
Topic starter
(@mariosgr)
Member
Joined: 6 years ago

this is for all links or i have to  add it for every link i want to change ?

Reply
Astghik
Posts: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @mariosgr,

The code I've provided in the previous post changes certain URL. If you need to change every URL, just use this code, it will replace any URL with an uncensored word.

add_filter('wpforo_content_after', function ($content) {
return preg_replace('@(href=[\'\"]https?://)[^/\'\"\?\&]+([^\'\"]*[\'\"])@is', '$uncensored$2', $content);
}, 999);
Reply
1 Reply
Customer
(@mariosgr)
Joined: 6 years ago

Member
Posts: 230

Is there a way to change the url with censure words from the actual plugin?

Because in your first code I need to add every single url that I want to change and in your second code it changes every url to what I input as "uncensored"

Reply
Posts: 230
Customer
Topic starter
(@mariosgr)
Member
Joined: 6 years ago

Thanks! It works and changes the url but for some reason it's no longer clickable, something must be missing

Reply
Astghik
Posts: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @mariosgr

I'm really sorry, but the plugin doesn't have such a feature. Our team provides you some custom codes to use. For more deeper customization you should find some developer. 

Reply
Page 2 / 2
Share:
Scroll to top