Plugin Author
ILLID
(@mihail-barinov)
Hi,
So do you see this image when you send a message to WhatsApp? I mean inside the feed or it still looks like just plain text with URL? If the second one – please show me an example of how it looks.
Regards
Yes it looks like plain text with URL, with file name showing at the bottom with a box where image should be as just a grey box as below screenshot:
https://postimg.cc/4KYmnT1T
Plugin Author
ILLID
(@mihail-barinov)
So when you press Send – inside the feed do you see the same plain text or image attached to the message after sending?
Yes, after sending I see a link and image name but no image / preview like below:
https://postimg.cc/YhbDmGcF
Plugin Author
ILLID
(@mihail-barinov)
Please try to use this code snippet:
add_action( 'wp_enqueue_scripts', 'sti_wp_enqueue_scripts', 9999999 );
function sti_wp_enqueue_scripts() {
$script = "
function sti_url( url, options ) {
if ( options.data.network === 'whatsapp' ) {
url = 'https://api.whatsapp.com/send?';
url += 'text=' + encodeURIComponent( options.data.title + ' | ' + options.data.summary + ' ' + options.data.media );
}
return url;
}
StiHooks.add_filter( 'sti_sharing_url', sti_url );
";
wp_add_inline_script( 'sti-script', $script);
}
Thanks, I am getting the following error message:
(I am installing via Code Snippets plugin)
Cannot redeclare sti_wp_enqueue_scripts() (previously declared in /srv/htdocs/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(292) : eval()'d code:3)
Plugin Author
ILLID
(@mihail-barinov)
Looks like you didn’t remove a previous code snippet. Please disable/remove it and try one more time.
Thanks this snippet is now active, however the preview still isn’t showing?