File: /var/www/html/insiders/wp-load/wp-content/plugins/breadly/block-extensions/block-id.php
<?php
defined( 'GTM_BLOCK_SUPPORT_ID_KEY' ) || define( 'GTM_BLOCK_SUPPORT_ID_KEY', 'gtmBlockId' );
/**
* Registers the align block attribute for block types that support it.
*
* @param WP_Block_Type $block_type Block Type.
*/
function gtm_register_block_id_support( $block_type ) {
if ( ! $block_type->attributes ) {
$block_type->attributes = [];
}
if ( ! array_key_exists( 'gtmBlockId', $block_type->attributes ) ) {
$block_type->attributes['gtmBlockId'] = [
'type' => 'string',
'default' => "",
];
}
}
// Register the block support.
WP_Block_Supports::get_instance()->register(
GTM_BLOCK_SUPPORT_ID_KEY,
[
'register_attribute' => 'gtm_register_block_id_support',
]
);