Home Forums Gutenberg Get ancestor blocks


Get ancestor blocks

  • I have created a custom ACF block with a block.json configuration. This block could either be used as a top level component in a post or page, or inside a regular WP query loop block. The block hierarchy would then be:

    Query Loop -> Post Template -> MyCustom Block

    In the render template I want the check if the block is currently used as a child inside a query loop block or not. Is that somehow possible?

    Maybe someone knows a good solution.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.