first try
This commit is contained in:
21
blocks-register.php
Normal file
21
blocks-register.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
function ssi_register_space_status_block() : void {
|
||||
$asset_path = plugin_dir_path( __FILE__ ) . 'build/space-status';
|
||||
register_block_type( $asset_path, [
|
||||
'render_callback' => 'ssi_render_block',
|
||||
] );
|
||||
}
|
||||
add_action( 'init', 'ssi_register_space_status_block' );
|
||||
|
||||
/**
|
||||
* Server‑side markup for the block.
|
||||
*/
|
||||
function ssi_render_block( array $attributes, string $content ) : string {
|
||||
// Re‑use existing helper & CSS class logic.
|
||||
return ssi_shortcode();
|
||||
}
|
||||
Reference in New Issue
Block a user