File: /var/www/html/insiders/wp-load/wp-content/plugins/breadly/block-library/template-summary.php
<?php
/**
* Renders the `gtm/template-summary` block on the server.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
* @return string Returns the template summary.
*/
function gtm_render_block_template_summary( $attr, $content, $block ) {
if ( ! isset( $block->context['gtmTemplateSummary'] ) ) {
return '';
}
$template_summary = $block->context['gtmTemplateSummary'];
$inner_html = sprintf( '<span class="wp-block-gtm-template-summary__summary">%s</span>', esc_html( $template_summary ) );
$wrapper_attributes = get_block_wrapper_attributes( ['class' => ''] );
return sprintf(
'<div %1$s>%2$s</div>',
$wrapper_attributes,
$inner_html
);
}
/**
* Registers the `gtm/template-summary` block on the server.
*/
function gtm_register_block_template_summary() {
gtm_register_block_type( 'template-summary', [
'render_callback' => 'gtm_render_block_template_summary',
] );
}
add_action( 'init', 'gtm_register_block_template_summary', 20 );