Custom Fields
Re-Envisioned
Support MB Blocks MB Blocks get_the_ID() does not work in preview/gutenberg editor

  • Creator
    Topic
  • #32781
    Resolved Michele Schembri
    Participant

    I am currently using MB Blocks to create custom blocks that will show certain elements based on the post they are being used in. To give an example, for example, I would like to show a list of categories based on the current post. When the page is rendered on the front end, all works well as the method get_the_id() returns the post's ID, however this is not being retrieved when in Gutenberg Editor, even after the post was published (so the ID exists). Is there any alternative to get_the_ID I can use in order to be able to show data in the preview/gutenberg editor?

    Thanks!

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