admin管理员组

文章数量:1391975

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.

本文标签: block editorWhere to save Gutenberg plugin data