Answer the question
In order to leave comments, you need to log in
How to convert the link to the required code when the link is placed in the full or short description of a Woocommerce product?
Hello.
Now in Woocommerce it is done so that when you place a link to a Youtube video in a full or short description of a product, for example:
https://youtu.be/fllbcAoYtK4
The link is automatically converted to a video player:
Tell me how to do the same, for example, with a link from Yandex. Music, for example, such a link is placed in the full or brief description of the product:
https://music.yandex.ru/album/5813591/track/43643085
and the user sees the Yandex audio player:
This is how the Yandex.Music code looks like:
<iframe frameborder="0" style="border:none;width:100%;height:180px;" width="100%" height="180" src="https://music.yandex.ru/iframe/#track/43643085/5813591">Слушайте <a href='https://music.yandex.ru/album/5813591/track/43643085'>Mad World (From "Donnie Darko")</a> — <a href='https://music.yandex.ru/artist/6231720'>Voidoid</a> на Яндекс.Музыке</iframe>
Answer the question
In order to leave comments, you need to log in
You can solve this issue using the iframely service and the WordPress plugin of the same name .
This is called Embeds , implemented by the oEmbed protocol . Here is a list of supported services out of the box. You can add your own using wp_oembed_add_provider() .
Thank you all for your participation. However, I could not implement it myself on the basis of the suggested tips due to a lack of knowledge, but I managed to find a ready-made solution. The following material showed me that there is a whole niche of related plugins:
https://premium.wpmudev.org/blog/embedding-wordpre... and already among them I found a plugin that allows you to convert the Yandex link as I need:
https:// wordpress.org/plugins/iframely/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question