File: /var/www/html/insiders/wp-load/wp-content/plugins/gutenmate/block-library/amp-code.php
<?php
/**
* Registers the `gtm/amp-code` block on the server.
*/
function gtm_register_block_amp_code() {
gtm_register_block_type( 'amp-code', [
'render_callback' => 'gtm_render_block_amp_code',
] );
}
add_action( 'init', 'gtm_register_block_amp_code', 20 );
/**
* Renders the `gtm/amp-code` 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 breadcrumbs.
*/
function gtm_render_block_amp_code( $attr, $content, $block ) {
if ( ! empty( $attr['script'] ) ) {
gtm_use_amp_script( $attr['script'] );
}
return $content;
}