Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Apr 30, 2020 3:34 pm
Hi Guys!
Is there a way to show converted URL images without the source link?
Thanks in advance.
1 Reply
May 01, 2020 1:22 pm
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.