HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
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 );