无法在Wordpress中嵌入网站

问题描述

有人可以帮助我了解如何调试此程序以及怎么做吗?

简而言之

我创建了一个嵌入式的提供程序并将其添加wordpress中。我看到wordpress响应正确的json。但是在提供的网址上没有图片的进一步要求。

我所知道的

所以基本上我有一个WordPress网站,我想在写帖子时嵌入我的另一个网站的图片

添加

wp_oembed_add_provider( 'https://dynamicallyLoadedSPA.com/*','https://laravelBackend.com/oembed/',false );

functions在functions.PHP中(在WordPress网站中)。之后,现在当我在撰写文章时粘贴链接时,就会发生嵌入过程,但仍然没有图片或其他任何内容。我不知道该如何调试。

我在Nginx日志中看到了

/oembed/?maxwidth=1060&maxheight=1000&url=https://dynamicallyLoadedSPA.com/some-link-with-picture-and-description&dnt=1&format=json

wordpress确实向该端点发出了请求。

如果我在浏览器中发出相同的请求,我的laravel后端将返回:

{
    "title": "Sausages","description": "expiration date: 2020.10.01,10euro","url": "https://dynamicallyLoadedSPA.com/sausages","type": "image","tags": "food","image": "https://img.laravelBackend.com/goods/4289/Untitled-2-04.jpg","code": "<img src='https://img.laravelBackend.com/goods/4289/Untitled-2-04.jpg'>"
}

但是woordpress收到此消息后,

https://img.laravelBackend.com/goods/4289/Untitled-2-04.jpg

端点。

我不知道这有什么问题或如何调试。 woordpress为什么不请求图片并将其显示在帖子和帖子编辑器UI中?请帮忙。

我希望在woordpress“ gutenberg”编辑器中粘贴链接时会出现带有说明的图片

ps。当我在gutenberg编辑器中查看可视化可编辑块的html时,这就是生成的html(一切似乎都按顺序排列)

<figure class="wp-block-embed"><div class="wp-block-embed__wrapper">
https://dynamicallyLoadedSPA.com/sausages
</div></figure>

it's just blank in the editor,no description,no image

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)