21 lines
541 B
PHP
21 lines
541 B
PHP
<?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();
|
||
} |