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?
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users