From 9d9569c52b07a62cd5037ae0839b356a5720b2cf Mon Sep 17 00:00:00 2001 From: shimotmk Date: Mon, 23 Feb 2026 17:11:15 +0900 Subject: [PATCH 1/3] add-social-link-line-note --- includes/block-hook/index.php | 1 + src/block-hook/social-link/block.json | 4 +++ src/block-hook/social-link/index.js | 35 +++++++++++++++++++++++++++ src/block-hook/social-link/index.php | 31 ++++++++++++++++++++++++ src/block-hook/social-link/style.scss | 7 ++++++ 5 files changed, 78 insertions(+) create mode 100644 src/block-hook/social-link/block.json create mode 100644 src/block-hook/social-link/index.js create mode 100644 src/block-hook/social-link/index.php create mode 100644 src/block-hook/social-link/style.scss diff --git a/includes/block-hook/index.php b/includes/block-hook/index.php index 115de784..f82b188c 100644 --- a/includes/block-hook/index.php +++ b/includes/block-hook/index.php @@ -39,6 +39,7 @@ function mone_register_block_hook() { 'query-pagination-previous', 'quote', 'separator', + 'social-link', 'site-logo', 'table', 'template-part', diff --git a/src/block-hook/social-link/block.json b/src/block-hook/social-link/block.json new file mode 100644 index 00000000..883dd326 --- /dev/null +++ b/src/block-hook/social-link/block.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "editorScript": "file:./index.js" +} diff --git a/src/block-hook/social-link/index.js b/src/block-hook/social-link/index.js new file mode 100644 index 00000000..a7338d25 --- /dev/null +++ b/src/block-hook/social-link/index.js @@ -0,0 +1,35 @@ +import { registerBlockVariation } from '@wordpress/blocks'; +import { Path, SVG } from '@wordpress/primitives'; +import './style.scss'; + +const NoteIcon = ( + + + +); + +const LineIcon = ( + + + +); + +registerBlockVariation( 'core/social-link', { + name: 'mone/note', + title: 'Note', + icon: NoteIcon, + attributes: { + service: 'mone-note', + }, + isActive: [ 'service' ], +} ); + +registerBlockVariation( 'core/social-link', { + name: 'mone/line', + title: 'Line', + icon: LineIcon, + attributes: { + service: 'mone-line', + }, + isActive: [ 'service' ], +} ); diff --git a/src/block-hook/social-link/index.php b/src/block-hook/social-link/index.php new file mode 100644 index 00000000..a466374b --- /dev/null +++ b/src/block-hook/social-link/index.php @@ -0,0 +1,31 @@ + 'Note', + 'icon' => '' + ]; + + $services_data['mone-line'] = [ + 'name' => 'Line', + 'icon' => '' + ]; + + return $services_data; +} +add_filter( 'block_core_social_link_get_services', __NAMESPACE__ . '\droplet_block_core_social_link' ); diff --git a/src/block-hook/social-link/style.scss b/src/block-hook/social-link/style.scss new file mode 100644 index 00000000..d9087df1 --- /dev/null +++ b/src/block-hook/social-link/style.scss @@ -0,0 +1,7 @@ +.wp-block-social-links .wp-social-link-mone-note { + color: #040000; +} + +.wp-block-social-links .wp-social-link-mone-line { + color: #00c300; +} \ No newline at end of file From a41805c8ee7848cf78d12e07bbac9d1c01c9179b Mon Sep 17 00:00:00 2001 From: shimotmk Date: Mon, 23 Feb 2026 17:14:09 +0900 Subject: [PATCH 2/3] lint --- src/block-hook/social-link/index.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/block-hook/social-link/index.php b/src/block-hook/social-link/index.php index a466374b..d5460222 100644 --- a/src/block-hook/social-link/index.php +++ b/src/block-hook/social-link/index.php @@ -12,19 +12,22 @@ } /** - * A method responsible for adding the data for rendering the block on frontend. + * Add Note and Line to the list of social link services. + * + * @param array $services_data The existing services data. + * @return array The modified services data with Note and Line added. */ function droplet_block_core_social_link( $services_data ) { - $services_data['mone-note'] = [ + $services_data['mone-note'] = array( 'name' => 'Note', - 'icon' => '' - ]; + 'icon' => '', + ); - $services_data['mone-line'] = [ + $services_data['mone-line'] = array( 'name' => 'Line', 'icon' => '' - ]; + ', + ); return $services_data; } From 50e2e682a00daa5536d1a3058b346744d035b60c Mon Sep 17 00:00:00 2001 From: shimotmk Date: Mon, 23 Feb 2026 17:14:35 +0900 Subject: [PATCH 3/3] lint --- src/block-hook/social-link/style.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/block-hook/social-link/style.scss b/src/block-hook/social-link/style.scss index d9087df1..58baac4a 100644 --- a/src/block-hook/social-link/style.scss +++ b/src/block-hook/social-link/style.scss @@ -1,7 +1,7 @@ .wp-block-social-links .wp-social-link-mone-note { - color: #040000; + color: #040000; } .wp-block-social-links .wp-social-link-mone-line { - color: #00c300; -} \ No newline at end of file + color: #00c300; +}