The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Image URL conversio...
 
Share:
Notifications
Clear all

Image URL conversion without link

2 Posts
2 Users
0 Likes
849 Views
Posts: 15
 igor
Topic starter
(@igor)
Eminent Member
Joined: 4 years ago

Hi Guys!

Is there a way to show converted URL images without the source link?

Thanks in advance.

1 Reply
Alina
Posts: 71
Moderator
(@alina)
Member
Joined: 4 years ago

Hi @igor,

Please put the following  code in the functions.php file of the active theme:


add_filter('comment_text', function ($content, $comment, $args = []) {
$wpdiscuz = wpDiscuz();
if ($wpdiscuz->isWpdiscuzLoaded) {
$content = preg_replace_callback('@src\s*=\s*"(.+?)"@is', function ($matches) {
$file = get_headers($matches[1], 1);
return 'src="data: ' . $file['Content-Type'] . ';base64,' . base64_encode(file_get_contents($matches[1])) . '"';
}, $content);
}
return $content;
}, 999, 3);

Please don't forget to delete all caches and press CTRL+F5(twice) on the frontend before checking.

Also please note the code provided above will change all images as you describe in the post above.

Reply
Share: