diff --git a/README.md b/README.md index 6f447ec..8c65ef5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Small WordPress plugin to consume an SpaceAPI endpoint and indicate on the WordP ## Usage +### WordPress Editor Block (Gutenberg) + +You can use the `Space Status` block in the WordPress editor to display the status of the SpaceAPI endpoint. + ### Shortcode You can use the shortcode `[space_status]` to display the status of the SpaceAPI endpoint on your WordPress site. @@ -13,3 +17,8 @@ You can use the shortcode `[space_status]` to display the status of the SpaceAPI ### Widget You can also use the widget `SpaceAPI Status` to display the status of the SpaceAPI endpoint in your WordPress sidebar or footer. + +## Changes + +### 0.4.x +- Added WordPress Editor Block (Gutenberg) support \ No newline at end of file diff --git a/src/space-status/editor.css b/src/space-status/editor.css index e69de29..babbfd2 100644 --- a/src/space-status/editor.css +++ b/src/space-status/editor.css @@ -0,0 +1,7 @@ +/* Editor-only: make the pill obvious & easy to select */ +.wp-block-wp-spaceapi-consumer-space-status { + display: inline-block; + padding: 4px 8px; + border: 1px dashed var(--wp-admin-theme-color, #007cba); + border-radius: 9999px; +} diff --git a/src/space-status/style.css b/src/space-status/style.css index 97e7011..9e2fe47 100644 --- a/src/space-status/style.css +++ b/src/space-status/style.css @@ -1 +1 @@ -@import url('../wp-spaceapi-consumer-style.css'); \ No newline at end of file +@import url('../../wp-spaceapi-consumer-style.css'); \ No newline at end of file diff --git a/wp-spaceapi-consumer.php b/wp-spaceapi-consumer.php index c3b38a3..16fb186 100644 --- a/wp-spaceapi-consumer.php +++ b/wp-spaceapi-consumer.php @@ -4,7 +4,7 @@ * Plugin Slug: wp-spaceapi-consumer * Plugin URI: https://gitea.alluna.pt/jfig/wp-spaceapi-consumer * Description: WordPress plugin to consume a SpaceAPI endpoint and indicate if the Space is Open or Closed - * Version: 0.3.0 + * Version: 0.4.0 * Author: Joao Figueiredo, LCD Porto Team, ChatGPT o3 * Author URI: https://lcdporto.org * License: MIT @@ -167,4 +167,10 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { } ); } +// Gutenberg block support (dynamic Space Status block) +if ( function_exists( 'register_block_type' ) ) { + require_once plugin_dir_path( __FILE__ ) . 'blocks-register.php'; +} + + // End of file