Where to save Gutenberg plugin data?

Question

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

enter image description here

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
, , Tomas Vavrinka 4 years 2020-02-16T08:38:58-05:00 0 Answers 61 views 0

Leave an answer

Browse
Browse