Files
wp-spaceapi-consumer/blocks-register.php
2025-06-13 23:36:21 +01:00

21 lines
541 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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' );
/**
* Serverside markup for the block.
*/
function ssi_render_block( array $attributes, string $content ) : string {
// Reuse existing helper & CSS class logic.
return ssi_shortcode();
}