admin管理员组文章数量:1300023
I want to write a plugin that uses the Wordpress5 methods of embedding media. I want a block where users can insert URLs. Then use WordPress methods to find the provider and get the embeddable iframe.
Like you post a url from e.g. youtube, twitter to your post and you get an iframe with the embedded video, also determine if it is a valid youtube url. I do not want to use other plugins.
From browsing the gutenberg code. I found that the embed blocks use the oembed api. However I fail at sending requests to the /wp-json/oembed/1.0/proxy
as well as the /wp-json/oembed/1.0/embed
endpoint.
From the gutenberg test source I assume that it should return json with the iframe html and the provider.
How, if at all, can I use that api endpoint?
本文标签: embedJSON api oembed youtube
版权声明:本文标题:embed - JSON api oembed youtube 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741655567a2390738.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论