Skip to content
PHP Filters

lzb/block_render/allow_inner_blocks_wrapper

Filter for <InnerBlocks /> component wrapper.

See additional info here – https://www.lazyblocks.com/docs/blocks-code/php-callback/#innerblocks-wrapper

Attributes

NameTypeDescription
$allow_inner_blocks_wrapperBooleanallow wrapper rendering
$attributesArrayblock attributes

Additional Filters

NameDescription
lazyblock/BLOCK_SLUG/allow_inner_blocks_wrapperspecific block in the frontend only

Usage

PHP
function my_lzb_block_render_allow_inner_blocks_wrapper( $allow_inner_blocks_wrapper, $attributes, $context ) {
  // Disable inner blocks wrapper if there is a custom attribute "my-attribute"
  if ( isset( $attributes['my-attribute'] ) && $attributes['my-attribute'] ) {
    return false;
  }
 
  return $allow_inner_blocks_wrapper;
}
 
add_filter( 'lzb/block_render/allow_inner_blocks_wrapper', 'my_lzb_block_render_allow_inner_blocks_wrapper', 10, 3 );
PHP
function my_lzb_block_render_allow_inner_blocks_wrapper( $allow_inner_blocks_wrapper, $attributes, $context ) {
  // Disable inner-blocks wrapper for block "lazyblock/my-custom-block"
  return false;
}
 
add_filter( 'lazyblock/my-custom-block/allow_inner_blocks_wrapper', 'my_lzb_block_render_allow_inner_blocks_wrapper', 10, 3 );
PHP
// Disable inner-blocks wrapper for all blocks.
add_filter( 'lzb/block_render/allow_inner_blocks_wrapper', '__return_false' );

Was this article helpful?