D
D
DimDim77782019-10-25 18:34:17
WordPress
DimDim7778, 2019-10-25 18:34:17

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:
5db315e978443327857748.jpeg
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:
5db314fb2c4cb855509134.jpeg
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

3 answer(s)
M
Mikhail Kobzarev, 2022-04-06
@DimDim7778

You can solve this issue using the iframely service and the WordPress plugin of the same name .

I
Igor Vorotnev, 2019-10-25
@HeadOnFire

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() .

D
DimDim7778, 2019-10-27
@DimDim7778

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 question

Ask a Question

731 491 924 answers to any question