最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

block editor - Where to save Gutenberg plugin data?

programmeradmin0浏览0评论

I developed plugin where user can choose custom og:image.

I expect this to be part of response when I request data from REST API.

"meta": {
      "_title": "Custom Hello world Title!",
      "_description": "This is your first post. Edit or delete it, then start writing!",
      "_og_title": "Custom OG Hello world Title!",
      "_og_description": "Take a look at our first post. Edit or delete it, then start writing!",
      "_og_image": "http:\/\/localhost:8069\/wp-content\/uploads\/2019\/11\/maxresdefault-1024x576.jpg"
},

Since I save selected img url as post meta "_og_image", I achieved it.

BUT! For correct displaying data in Gutenberg I need also somewhere to save the image Id. Then It will allow me to do not load large version of selected image but choose the small one. Also when I have the Id I can pre-select currently used image in media libray.

So to where am I supposed to save the Id? I find stupid to create another meta for this purpose.

发布评论

评论列表(0)

  1. 暂无评论