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/gutenmate/block-supports/footer-content.php
<?php
defined( 'GTM_BLOCK_SUPPORT_FOOTER_CONTENT_KEY' ) || define( 'GTM_BLOCK_SUPPORT_FOOTER_CONTENT_KEY', 'gtmFooterContent' );

function gtm_getBlockFooterContentSupport( $block_type ) {
	$support = gtm_get_block_support( $block_type, [GTM_BLOCK_SUPPORT_FOOTER_CONTENT_KEY], false );

	return $support ? true : false;
}

// Register the block support.
WP_Block_Supports::get_instance()->register(
	GTM_BLOCK_SUPPORT_FOOTER_CONTENT_KEY,
	[]
);

/**
 * Render out the stylesheet.
 *
 * @param  string $block_content Rendered block content.
 * @param  array  $block         Block object.
 * @return string                Filtered block content.
 */
add_filter( 'render_block', 'gtm_render_footer_content_support', PHP_INT_MAX, 2 );
function gtm_render_footer_content_support( $block_content, $block ) {
	$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
	$support    = gtm_getBlockFooterContentSupport( $block_type );

	if ( $support && apply_filters( 'gtm_allow_footer_content', true ) ) {
		// Move content to footer
		add_action( 'wp_footer', function () use ( $block_content ) {
			echo trim( $block_content ?? '' );
		} );

		return '';
	}

	return $block_content;
}