JavaScript for WordPress Forums Gutenberg Development Getting post meta data from another post in Gutenberg

This topic contains 0 replies, has 1 voice, and was last updated by  Phil 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #67068

    Phil
    Participant

    Hi guys,

    Is there a way within Gutenberg to dynamically pull in post meta data from another post and use it in a Gutenberg block? I have an image ID saved in the post meta in another post and would like to display the image within the editor.

    Looking at the Gutenberg documentation it’s possible to use a data source attribute and point it towards the current post’s meta data but not a different post. I can see a way around it by setting up an http endpoint within the plugin that returns the image src based on a given post ID and shooting off an AJAX request to it, but is there better way to go about it?

    Thanks!

    • This topic was modified 1 month ago by  Phil.
    • This topic was modified 1 month ago by  Phil.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.