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

Viewing 2 posts - 1 through 2 (of 2 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!

    #104121
    Chris
    Participant

    If anyone has any ideas or leads on this, that would be very helpful to me too!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.