• Hi there,
    I would like to get all blocks of the first level, so no child/grandchild etc. blocks. Let’s say I have the following hierarchy, I would like to only select the Block from level 1. This ideally needs to happen in PHP, when I am trying to call the following:

    add_filter('render_block', 'Proctor\Blocks\addBlockWrapper', 10, 2);

    • Block Level 1
    • Block Level 2
    • Block Level 3
    • Block Level 3
    • Block Level 3
    • Block Level 2
    • Block Level 2
    • Block Level 1
    • Block Level 2
    • Block Level 2
    • Block Level 2
    • Block Level 1
    • Block Level 1
    • Block Level 1
    • I hope it’s clear what I mean! Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter landwire

    (@landwire)

    level 1
    level 2
    level 3
    level 2
    level 1
    level 1

    Thread Starter landwire

    (@landwire)

    Ok, all the indentations dont work…

    Thread Starter landwire

    (@landwire)

    
    Block Level 1
      Block Level 2
        Block Level 3
        Block Level 3
        Block Level 3
      Block Level 2
      Block Level 2
    Block Level 1
      Block Level 2
      Block Level 2
      Block Level 2
    Block Level 1
    Block Level 1
    Block Level 1
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I identify “top” level blocks in PHP?’ is closed to new replies.