diff options
Diffstat (limited to '')
-rw-r--r-- | wp-includes/blocks/shortcode.php | 31 | ||||
-rw-r--r-- | wp-includes/blocks/shortcode/block.json | 21 | ||||
-rw-r--r-- | wp-includes/blocks/shortcode/editor-rtl.css | 27 | ||||
-rw-r--r-- | wp-includes/blocks/shortcode/editor-rtl.min.css | 1 | ||||
-rw-r--r-- | wp-includes/blocks/shortcode/editor.css | 27 | ||||
-rw-r--r-- | wp-includes/blocks/shortcode/editor.min.css | 1 |
6 files changed, 108 insertions, 0 deletions
diff --git a/wp-includes/blocks/shortcode.php b/wp-includes/blocks/shortcode.php new file mode 100644 index 0000000..97a40b3 --- /dev/null +++ b/wp-includes/blocks/shortcode.php @@ -0,0 +1,31 @@ +<?php +/** + * Server-side rendering of the `core/shortcode` block. + * + * @package WordPress + */ + +/** + * Performs wpautop() on the shortcode block content. + * + * @param array $attributes The block attributes. + * @param string $content The block content. + * + * @return string Returns the block content. + */ +function render_block_core_shortcode( $attributes, $content ) { + return wpautop( $content ); +} + +/** + * Registers the `core/shortcode` block on server. + */ +function register_block_core_shortcode() { + register_block_type_from_metadata( + __DIR__ . '/shortcode', + array( + 'render_callback' => 'render_block_core_shortcode', + ) + ); +} +add_action( 'init', 'register_block_core_shortcode' ); diff --git a/wp-includes/blocks/shortcode/block.json b/wp-includes/blocks/shortcode/block.json new file mode 100644 index 0000000..22d838a --- /dev/null +++ b/wp-includes/blocks/shortcode/block.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/shortcode", + "title": "Shortcode", + "category": "widgets", + "description": "Insert additional custom elements with a WordPress shortcode.", + "textdomain": "default", + "attributes": { + "text": { + "type": "string", + "source": "raw" + } + }, + "supports": { + "className": false, + "customClassName": false, + "html": false + }, + "editorStyle": "wp-block-shortcode-editor" +} diff --git a/wp-includes/blocks/shortcode/editor-rtl.css b/wp-includes/blocks/shortcode/editor-rtl.css new file mode 100644 index 0000000..47d6207 --- /dev/null +++ b/wp-includes/blocks/shortcode/editor-rtl.css @@ -0,0 +1,27 @@ +[data-type="core/shortcode"].components-placeholder{ + min-height:0; +} + +.blocks-shortcode__textarea{ + background:#fff !important; + border:1px solid #1e1e1e !important; + border-radius:2px !important; + box-shadow:none !important; + box-sizing:border-box; + color:#1e1e1e !important; + font-family:Menlo,Consolas,monaco,monospace !important; + font-size:16px !important; + max-height:250px; + padding:12px !important; + resize:none; +} +@media (min-width:600px){ + .blocks-shortcode__textarea{ + font-size:13px !important; + } +} +.blocks-shortcode__textarea:focus{ + border-color:var(--wp-admin-theme-color) !important; + box-shadow:0 0 0 1px var(--wp-admin-theme-color) !important; + outline:2px solid transparent !important; +}
\ No newline at end of file diff --git a/wp-includes/blocks/shortcode/editor-rtl.min.css b/wp-includes/blocks/shortcode/editor-rtl.min.css new file mode 100644 index 0000000..8128a65 --- /dev/null +++ b/wp-includes/blocks/shortcode/editor-rtl.min.css @@ -0,0 +1 @@ +[data-type="core/shortcode"].components-placeholder{min-height:0}.blocks-shortcode__textarea{background:#fff!important;border:1px solid #1e1e1e!important;border-radius:2px!important;box-shadow:none!important;box-sizing:border-box;color:#1e1e1e!important;font-family:Menlo,Consolas,monaco,monospace!important;font-size:16px!important;max-height:250px;padding:12px!important;resize:none}@media (min-width:600px){.blocks-shortcode__textarea{font-size:13px!important}}.blocks-shortcode__textarea:focus{border-color:var(--wp-admin-theme-color)!important;box-shadow:0 0 0 1px var(--wp-admin-theme-color)!important;outline:2px solid transparent!important}
\ No newline at end of file diff --git a/wp-includes/blocks/shortcode/editor.css b/wp-includes/blocks/shortcode/editor.css new file mode 100644 index 0000000..47d6207 --- /dev/null +++ b/wp-includes/blocks/shortcode/editor.css @@ -0,0 +1,27 @@ +[data-type="core/shortcode"].components-placeholder{ + min-height:0; +} + +.blocks-shortcode__textarea{ + background:#fff !important; + border:1px solid #1e1e1e !important; + border-radius:2px !important; + box-shadow:none !important; + box-sizing:border-box; + color:#1e1e1e !important; + font-family:Menlo,Consolas,monaco,monospace !important; + font-size:16px !important; + max-height:250px; + padding:12px !important; + resize:none; +} +@media (min-width:600px){ + .blocks-shortcode__textarea{ + font-size:13px !important; + } +} +.blocks-shortcode__textarea:focus{ + border-color:var(--wp-admin-theme-color) !important; + box-shadow:0 0 0 1px var(--wp-admin-theme-color) !important; + outline:2px solid transparent !important; +}
\ No newline at end of file diff --git a/wp-includes/blocks/shortcode/editor.min.css b/wp-includes/blocks/shortcode/editor.min.css new file mode 100644 index 0000000..8128a65 --- /dev/null +++ b/wp-includes/blocks/shortcode/editor.min.css @@ -0,0 +1 @@ +[data-type="core/shortcode"].components-placeholder{min-height:0}.blocks-shortcode__textarea{background:#fff!important;border:1px solid #1e1e1e!important;border-radius:2px!important;box-shadow:none!important;box-sizing:border-box;color:#1e1e1e!important;font-family:Menlo,Consolas,monaco,monospace!important;font-size:16px!important;max-height:250px;padding:12px!important;resize:none}@media (min-width:600px){.blocks-shortcode__textarea{font-size:13px!important}}.blocks-shortcode__textarea:focus{border-color:var(--wp-admin-theme-color)!important;box-shadow:0 0 0 1px var(--wp-admin-theme-color)!important;outline:2px solid transparent!important}
\ No newline at end of file |