File: /var/www/html/insiders/wp-load/wp-content/plugins/gutenmate/block-library/separator.php
<?php
/**
* Registers the `gtm/separator` block on the server.
*/
function gtm_register_block_separator() {
gtm_register_block_type( 'separator' );
}
add_action( 'init', 'gtm_register_block_separator', 20 );
add_filter( 'gtm.BlockStyleCompiler.gtm/separator', 'gtm_compile_block_css_separator', 10, 3 );
function gtm_compile_block_css_separator( $output, $attributes, $blockName ) {
$block_style = ['classes' => [], 'style' => []];
$block_style['classes'][] = 'gtm-block';
if ( $attributes['hideLoopFirstChild'] ) {
$block_style['classes'][] = 'gtm-hide-loop-first-child';
}
if ( $attributes['hideLoopLastChild'] ) {
$block_style['classes'][] = 'gtm-hide-loop-last-child';
}
gtm_css_compileCssVar( $block_style, "separator-border-style", $attributes['separatorStyle'] );
gtm_css_compileCssVar( $block_style, "separator-border-color", gtm_css_parseColorValue( $attributes['separatorColor'] ) );
gtm_css_compileCssVar( $block_style, "separator-border-thickness", $attributes['separatorThickness'] );
gtm_css_compileCssVar( $block_style, "separator-border-radius", gtm_css_parseBorderRadiusValue( $attributes['separatorRadius'] ) );
gtm_css_compileCssVar( $block_style, "separator-width", $attributes['separatorWidth'] );
// 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'] ),
];
}