File: /var/www/html/insiders/wp-load/wp-content/plugins/breadly/block-library/section-headline.php
<?php
/**
* Registers the `gtm/section-headline` block on the server.
*/
function gtm_register_block_section_headline() {
gtm_register_block_type( 'section-headline' );
}
add_action( 'init', 'gtm_register_block_section_headline', 20 );
add_filter( 'gtm.BlockStyleCompiler.gtm/section-headline', 'gtm_compile_block_css_section_headline', 10, 3 );
function gtm_compile_block_css_section_headline( $output, $attributes, $blockName ) {
$block_style = ['classes' => [], 'style' => []];
$block_style['classes'][] = 'gtm-block';
if ( ! empty( $attributes['enableHeadlineClipText'] ) ) {
$block_style['classes'][] = 'gtm-has-enable-headline-clip-text';
}
// Main headline
gtm_css_compileCssVar( $block_style, "section-headline-bg", gtm_css_parseColorValue( $attributes['headlineBg'] ) );
if ( empty( $attributes['enableHeadlineClipText'] ) ) {
gtm_css_compileCssVar( $block_style, "section-headline-color", gtm_css_parseColorValue( $attributes['headlineColor'] ) );
}
gtm_css_compileCssVar( $block_style, "section-headline-typography", gtm_css_parseTypographyProps( $attributes['headlineTypography'] ) );
gtm_css_compileCssVar( $block_style, "section-headline-width", $attributes['headlineWidth'] );
// Line
gtm_css_compileCssVar( $block_style, "section-headline-line-thickness", $attributes['lineThickness'] );
gtm_css_compileCssVar( $block_style, "section-headline-line-color", gtm_css_parseColorValue( $attributes['lineColor'] ) );
gtm_css_compileCssVar( $block_style, "section-headline-line-spacing", gtm_css_parseSpacingValue( $attributes['lineSpacing'] ) );
gtm_css_compileCssVar( $block_style, "section-headline-line-width", $attributes['lineWidth'] );
// Apply to output
$block_style['style'] = ['{{BLOCK}}' => $block_style['style']];
return [
'classes' => array_merge( $output['classes'], $block_style['classes'] ),
'style' => array_replace_recursive( $output['style'], $block_style['style'] ),
];
}