Support

Account

Home Forums Gutenberg Passing a variable to custom block from inside the editor.

Unread

Passing a variable to custom block from inside the editor.

    • quasi

    • April 24, 2021 at 12:45 am

    Hello,

    I need to pass the custom post type slug as a variable to a custom block made with ACF. This needs to happen when the block is placed for the first time in the editor.

    What I want to achieve, is that the block detects the post type and then stores that value so it can be used when rendering the block in the frontend. It can not be done by css classes (that would be the obvious solution). I need to be able to output the CPT slug as a string in the single CPT page.

    Con anyone give me a hint on how to achieve this?

    Thank you!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.