Support

Account

Home Forums Gutenberg Get ancestor blocks

Helping

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.

  • I am trying something similar, have you found any solution?
    I want to know which block is the ancestor.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.