WP_Block_Processor::get_depth
Returns the depth of the open blocks where the processor is currently matched.
Depth increases before visiting openers and void blocks and decreases before visiting closers. HTML spans behave like void blocks.
Method of the class: WP_Block_Processor{}
No Hooks.
Returns
Int.
Usage
$WP_Block_Processor = new WP_Block_Processor(); $WP_Block_Processor->get_depth(): int;
Changelog
| Since 6.9.0 | Introduced. |
WP_Block_Processor::get_depth() WP Block Processor::get depth code WP 6.9.1
public function get_depth(): int {
return count( $this->open_blocks_at );
}