Skip to content
PHP Filters

lzb/block_data

Filters all available block data, which moves to the frontend for block registration.

Attributes

NameTypeDescription
$block_dataArrayall block default data
$get_meta_valueFunctionget value of the registered block meta

Usage

PHP
function my_lzb_custom_block_meta_value( $block_data, $get_meta_value ) {
  // Set value to your custom block data.
  $block_data['my_custom_data'] = $get_meta_value('lazyblock_my_custom_data');
 
  return $block_data;
}
 
add_filter( 'lzb/block_data', 'my_lzb_custom_block_meta_value', 10, 2 );

Was this article helpful?