diff --git a/README.md b/README.md index e1a7b82..55b5b58 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,33 @@ -# Starting block +# Debug block * Contributors: bobbingwide -* Tags: block, starting, scaffold, SSR +* Tags: block, debug, scaffold, SSR * Tested up to: 5.7.0 * Stable tag: 0.0.0 * License: GPLv3 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -Starting point for a single block server side rendered block. +Debug point for a single block server side rendered block. -## Description -The Starting block plugin is a single block plugin to be used as the starting point for future Server Side Rendered blocks. +## Description +The Debug block plugin is a single block plugin to be used as the debug point for future Server Side Rendered blocks. -## Installation +## Installation The purpose of this plugin is to provide the source code for a Server Side Rendered block that is copied into an existing plugin where the new SSR logic replaces an existing shortcode. You should not need to activate this plugin. If you do, it's just like any other plugin. -## Screenshots -1. Starting block - rendered -2. Starting block - settings +## Screenshots +1. Debug block - rendered +2. Debug block - settings -## Upgrade Notice -# 0.0.0 +## Upgrade Notice +# 0.0.0 First version to be used to replace any `[your name here]` shortcodes in FSE themes -## Changelog -# 0.0.0 -* Added: First version of the server side rendered block,[#1](https://github.com/bobbingwide/sb-starting-block/issues/1) +## Changelog +# 0.0.0 +* Added: First version of the server side rendered block,[#1](https://github.com/bobbingwide/sb-debug-block/issues/1) * Tested: With WordPress 5.7.1 and WordPress Multi Site * Tested: With Gutenberg 10.6.0-rc.1 * Tested: With PHP 8.0 diff --git a/block.json b/block.json index 795d484..18b52f7 100644 --- a/block.json +++ b/block.json @@ -1,14 +1,14 @@ { "apiVersion": 2, - "name": "oik-sb/sb-starting-block", - "title": "Starting block", + "name": "oik-sb/sb-debug-block", + "title": "Debug block", "category": "widgets", - "icon": "megaphone", - "description": "Starting Server Side Rendered block", + "icon": "code-standards", + "description": "Debug Server Side Rendered block", "supports": { "html": false }, - "textdomain": "sb-starting-block", + "textdomain": "sb-debug-block", "editorScript": "file:./build/index.js", "editorStyle": "file:./build/index.css", "style": "file:./build/style-index.css" diff --git a/build/index.js b/build/index.js index 899d21f..cdff4df 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(window.webpackJsonp_sb_starting_block=window.webpackJsonp_sb_starting_block||[]).push([[1],{3:function(t,e,n){}}]),function(t){function e(e){for(var r,u,c=e[0],s=e[1],l=e[2],a=0,f=[];a 'oik_sb_sb_starting_block_dynamic_block']; +function oik_sb_sb_debug_block_block_init() { + $args = [ 'render_callback' => 'oik_sb_sb_debug_block_dynamic_block']; register_block_type_from_metadata( __DIR__, $args ); } -function oik_sb_sb_starting_block_loaded() { - add_action( 'init', 'oik_sb_sb_starting_block_block_init' ); +function oik_sb_sb_debug_block_loaded() { + add_action( 'init', 'oik_sb_sb_debug_block_block_init' ); } /** * Implements post-edit block. @@ -39,16 +39,16 @@ function oik_sb_sb_starting_block_loaded() { * * @return string */ -function oik_sb_sb_starting_block_dynamic_block( $attributes ) { +function oik_sb_sb_debug_block_dynamic_block( $attributes ) { $classes = ''; if ( isset( $attributes['textAlign'] ) ) { $classes .= 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); - $content = __( 'Starting block.', 'sb-starting-block'); + $content = __( 'Debug block.', 'sb-starting-block'); $html = sprintf( '
%2$s
', $wrapper_attributes, $content ); - // $html=\oik\oik_blocks\oik_blocks_check_server_func( "shortcodes/starting-block.php", "sb-starting-block", "oik_sb_sb_starting_block" ); + // $html=\oik\oik_blocks\oik_blocks_check_server_func( "shortcodes/starting-block.php", "sb-starting-block", "oik_sb_sb_debug_block" ); return $html; } -oik_sb_sb_starting_block_loaded(); +oik_sb_sb_debug_block_loaded(); diff --git a/src/starting-block/edit.js b/src/debug-block/edit.js similarity index 95% rename from src/starting-block/edit.js rename to src/debug-block/edit.js index d168242..b228547 100644 --- a/src/starting-block/edit.js +++ b/src/debug-block/edit.js @@ -33,7 +33,7 @@ import './editor.scss'; export default function Edit ( { attributes, className, isSelected, setAttributes } ) { return ( ); } diff --git a/src/starting-block/editor.scss b/src/debug-block/editor.scss similarity index 79% rename from src/starting-block/editor.scss rename to src/debug-block/editor.scss index ca93aab..191c560 100644 --- a/src/starting-block/editor.scss +++ b/src/debug-block/editor.scss @@ -4,6 +4,6 @@ * Replace them with your own styles or remove the file completely. */ -.wp-block-oik-sb-sb-starting-block { +.wp-block-oik-sb-sb-debug-block { } diff --git a/src/starting-block/index.js b/src/debug-block/index.js similarity index 94% rename from src/starting-block/index.js rename to src/debug-block/index.js index 2a61e2a..417e2c1 100644 --- a/src/starting-block/index.js +++ b/src/debug-block/index.js @@ -25,7 +25,7 @@ import save from './save'; * * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block */ -registerBlockType( 'oik-sb/sb-starting-block', { +registerBlockType( 'oik-sb/sb-debug-block', { /** * @see ./edit.js */ diff --git a/src/starting-block/save.js b/src/debug-block/save.js similarity index 100% rename from src/starting-block/save.js rename to src/debug-block/save.js diff --git a/src/starting-block/style.scss b/src/debug-block/style.scss similarity index 82% rename from src/starting-block/style.scss rename to src/debug-block/style.scss index a3c1c33..2139877 100644 --- a/src/starting-block/style.scss +++ b/src/debug-block/style.scss @@ -5,6 +5,6 @@ * Replace them with your own styles or remove the file completely. */ -.wp-block-oik-sb-sb-starting-block { +.wp-block-oik-sb-sb-debug-block { } diff --git a/src/index.js b/src/index.js index bba4e53..f48d8a8 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -import './starting-block'; +import './debug-block';