PHP Filters
lzb_pro/block_style/template
Filters block style template path for custom styling of blocks.
This filter allows you to customize the template path used for block styles in Lazy Blocks Pro.
Attributes
Name | Type | Description |
---|---|---|
$template | String | block style template path |
$template_name | String | template name |
$block | Array | block data |
$context | String | rendering context [editor , frontend ] |
Additional Filters
Name | Description |
---|---|
BLOCK_SLUG/frontend_style_template | specific block in the frontend only |
BLOCK_SLUG/editor_style_template | specific block in the editor only |
BLOCK_SLUG/style_template | specific block only |
Usage
function my_lzb_pro_block_style_template( $template, $template_name, $block, $context ) {
// Custom style template for all blocks
return '/YOUR_CUSTOM/STYLE/PATH.php';
}
add_filter( 'lzb_pro/block_style/template', 'my_lzb_pro_block_style_template', 10, 4 );
function my_lzb_pro_block_style_template( $template, $template_name, $block, $context ) {
// Custom style template for specific block
if ( $block['slug'] === 'my-custom-block' ) {
return '/YOUR_CUSTOM/STYLE/PATH.php';
}
return $template;
}
add_filter( 'lzb_pro/block_style/template', 'my_lzb_pro_block_style_template', 10, 4 );
function my_lzb_pro_block_style_template( $template, $template_name, $block ) {
// Custom style template for block "my-custom-block"
return '/YOUR_CUSTOM/STYLE/PATH.php';
}
add_filter( 'my-custom-block/style_template', 'my_lzb_pro_block_style_template', 10, 3 );