From 78d3ff391c52fce5f4cc95aeaebbdf8cc20bac0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=28Greg=29=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowsk?= =?UTF-8?q?i?= Date: Tue, 15 Oct 2019 15:35:03 +0000 Subject: [PATCH] Block Editor: Remove experimental Social Links blocks We decided to mark Social Links block as an experimental feature in Gutenberg. In effect, we are moving all related code from WordPress 5.3 release. Props youknowriad. Fixes #48263. git-svn-id: https://develop.svn.wordpress.org/trunk@46543 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/blocks/social-link.php | 227 --- src/wp-settings.php | 1 - .../tests/rest-api/rest-schema-setup.php | 39 - tests/qunit/fixtures/wp-api-generated.js | 1560 ----------------- tools/webpack/packages.js | 6 +- 5 files changed, 5 insertions(+), 1828 deletions(-) delete mode 100644 src/wp-includes/blocks/social-link.php diff --git a/src/wp-includes/blocks/social-link.php b/src/wp-includes/blocks/social-link.php deleted file mode 100644 index 4d04c9cd1c..0000000000 --- a/src/wp-includes/blocks/social-link.php +++ /dev/null @@ -1,227 +0,0 @@ - ' . $icon . ''; -} - -/** - * Registers the `core/social-link` blocks. - */ -function register_block_core_social_link() { - $sites = array( - 'amazon', - 'bandcamp', - 'behance', - 'chain', - 'codepen', - 'deviantart', - 'dribbble', - 'dropbox', - 'etsy', - 'facebook', - 'feed', - 'fivehundredpx', - 'flickr', - 'foursquare', - 'goodreads', - 'google', - 'github', - 'instagram', - 'lastfm', - 'linkedin', - 'mail', - 'mastodon', - 'meetup', - 'medium', - 'pinterest', - 'pocket', - 'reddit', - 'skype', - 'snapchat', - 'soundcloud', - 'spotify', - 'tumblr', - 'twitch', - 'twitter', - 'vimeo', - 'vk', - 'wordpress', - 'yelp', - 'youtube', - ); - - foreach ( $sites as $site ) { - register_block_type( - 'core/social-link-' . $site, - array( - 'attributes' => array( - 'url' => array( - 'type' => 'string', - ), - 'site' => array( - 'type' => 'string', - 'default' => $site, - ), - ), - 'render_callback' => 'render_core_social_link', - ) - ); - } -} -add_action( 'init', 'register_block_core_social_link' ); - - -/** - * Returns the SVG for social link. - * - * @param string $site The site icon. - * - * @return string SVG Element for site icon. - */ -function core_social_link_get_icon( $site ) { - switch ( $site ) { - - case 'fivehundredpx': - return ''; - - case 'amazon': - return ''; - - case 'bandcamp': - return ''; - - case 'behance': - return ''; - - case 'chain': - return ''; - - case 'codepen': - return ''; - - case 'deviantart': - return ''; - - case 'dribbble': - return ''; - - case 'dropbox': - return ''; - - case 'etsy': - return ''; - - case 'facebook': - return ''; - - case 'feed': - return ''; - - case 'flickr': - return ''; - - case 'foursquare': - return ''; - - case 'goodreads': - return ''; - - case 'google': - return ''; - - case 'github': - return ''; - - case 'instagram': - return ''; - - case 'lastfm': - return ''; - - case 'linkedin': - return ''; - - case 'mail': - return ''; - - case 'mastodon': - return ''; - - case 'meetup': - return ''; - - case 'medium': - return ''; - - case 'pinterest': - return ''; - - case 'pocket': - return ''; - - case 'reddit': - return ''; - - case 'skype': - return ''; - - case 'snapchat': - return ''; - - case 'soundcloud': - return ''; - - case 'spotify': - return ''; - - case 'tumblr': - return ''; - - case 'twitch': - return ''; - - case 'twitter': - return ''; - - case 'vimeo': - return ''; - - case 'vk': - return ''; - - // phpcs:disable WordPress.WP.CapitalPDangit.Misspelled - case 'wordpress': - return ''; - - case 'yelp': - return ''; - - case 'youtube': - return ''; - - case 'share': - default: - return ''; - } -} diff --git a/src/wp-settings.php b/src/wp-settings.php index 8f345a7704..a4d9a78316 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -269,7 +269,6 @@ require( ABSPATH . WPINC . '/blocks/latest-posts.php' ); require( ABSPATH . WPINC . '/blocks/rss.php' ); require( ABSPATH . WPINC . '/blocks/search.php' ); require( ABSPATH . WPINC . '/blocks/shortcode.php' ); -require( ABSPATH . WPINC . '/blocks/social-link.php' ); require( ABSPATH . WPINC . '/blocks/tag-cloud.php' ); $GLOBALS['wp_embed'] = new WP_Embed(); diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index 51abf95fc1..0aeebb4352 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -129,45 +129,6 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { '/wp/v2/block-renderer/(?Pcore/rss)', '/wp/v2/block-renderer/(?Pcore/search)', '/wp/v2/block-renderer/(?Pcore/shortcode)', - '/wp/v2/block-renderer/(?Pcore/social-link-amazon)', - '/wp/v2/block-renderer/(?Pcore/social-link-bandcamp)', - '/wp/v2/block-renderer/(?Pcore/social-link-behance)', - '/wp/v2/block-renderer/(?Pcore/social-link-chain)', - '/wp/v2/block-renderer/(?Pcore/social-link-codepen)', - '/wp/v2/block-renderer/(?Pcore/social-link-deviantart)', - '/wp/v2/block-renderer/(?Pcore/social-link-dribbble)', - '/wp/v2/block-renderer/(?Pcore/social-link-dropbox)', - '/wp/v2/block-renderer/(?Pcore/social-link-etsy)', - '/wp/v2/block-renderer/(?Pcore/social-link-facebook)', - '/wp/v2/block-renderer/(?Pcore/social-link-feed)', - '/wp/v2/block-renderer/(?Pcore/social-link-fivehundredpx)', - '/wp/v2/block-renderer/(?Pcore/social-link-flickr)', - '/wp/v2/block-renderer/(?Pcore/social-link-foursquare)', - '/wp/v2/block-renderer/(?Pcore/social-link-goodreads)', - '/wp/v2/block-renderer/(?Pcore/social-link-google)', - '/wp/v2/block-renderer/(?Pcore/social-link-github)', - '/wp/v2/block-renderer/(?Pcore/social-link-instagram)', - '/wp/v2/block-renderer/(?Pcore/social-link-lastfm)', - '/wp/v2/block-renderer/(?Pcore/social-link-linkedin)', - '/wp/v2/block-renderer/(?Pcore/social-link-mail)', - '/wp/v2/block-renderer/(?Pcore/social-link-mastodon)', - '/wp/v2/block-renderer/(?Pcore/social-link-meetup)', - '/wp/v2/block-renderer/(?Pcore/social-link-medium)', - '/wp/v2/block-renderer/(?Pcore/social-link-pinterest)', - '/wp/v2/block-renderer/(?Pcore/social-link-pocket)', - '/wp/v2/block-renderer/(?Pcore/social-link-reddit)', - '/wp/v2/block-renderer/(?Pcore/social-link-skype)', - '/wp/v2/block-renderer/(?Pcore/social-link-snapchat)', - '/wp/v2/block-renderer/(?Pcore/social-link-soundcloud)', - '/wp/v2/block-renderer/(?Pcore/social-link-spotify)', - '/wp/v2/block-renderer/(?Pcore/social-link-tumblr)', - '/wp/v2/block-renderer/(?Pcore/social-link-twitch)', - '/wp/v2/block-renderer/(?Pcore/social-link-twitter)', - '/wp/v2/block-renderer/(?Pcore/social-link-vimeo)', - '/wp/v2/block-renderer/(?Pcore/social-link-vk)', - '/wp/v2/block-renderer/(?Pcore/social-link-wordpress)', - '/wp/v2/block-renderer/(?Pcore/social-link-yelp)', - '/wp/v2/block-renderer/(?Pcore/social-link-youtube)', '/wp/v2/block-renderer/(?Pcore/tag-cloud)', '/wp/v2/settings', '/wp/v2/themes', diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 2b5f8d38e9..816b5d53eb 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -4743,1566 +4743,6 @@ mockedApiResponse.Schema = { } ] }, - "/wp/v2/block-renderer/(?Pcore/social-link-amazon)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-amazon block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-bandcamp)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-bandcamp block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-behance)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-behance block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-chain)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-chain block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-codepen)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-codepen block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-deviantart)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-deviantart block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-dribbble)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-dribbble block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-dropbox)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-dropbox block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-etsy)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-etsy block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-facebook)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-facebook block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-feed)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-feed block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-fivehundredpx)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-fivehundredpx block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-flickr)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-flickr block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-foursquare)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-foursquare block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-goodreads)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-goodreads block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-google)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-google block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-github)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-github block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-instagram)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-instagram block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-lastfm)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-lastfm block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-linkedin)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-linkedin block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-mail)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-mail block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-mastodon)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-mastodon block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-meetup)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-meetup block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-medium)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-medium block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-pinterest)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-pinterest block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-pocket)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-pocket block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-reddit)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-reddit block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-skype)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-skype block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-snapchat)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-snapchat block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-soundcloud)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-soundcloud block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-spotify)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-spotify block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-tumblr)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-tumblr block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-twitch)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-twitch block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-twitter)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-twitter block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-vimeo)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-vimeo block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-vk)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-vk block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-wordpress)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-wordpress block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-yelp)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-yelp block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, - "/wp/v2/block-renderer/(?Pcore/social-link-youtube)": { - "namespace": "wp/v2", - "methods": [ - "GET" - ], - "endpoints": [ - { - "methods": [ - "GET" - ], - "args": { - "name": { - "required": false, - "description": "Unique registered name for the block.", - "type": "string" - }, - "context": { - "required": false, - "default": "view", - "enum": [ - "edit" - ], - "description": "Scope under which the request is made; determines fields present in response.", - "type": "string" - }, - "attributes": { - "required": false, - "default": [], - "description": "Attributes for core/social-link-youtube block", - "type": "object" - }, - "post_id": { - "required": false, - "description": "ID of the post context.", - "type": "integer" - } - } - } - ] - }, "/wp/v2/block-renderer/(?Pcore/tag-cloud)": { "namespace": "wp/v2", "methods": [ diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index a64bbb1337..eb97169d88 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -1,6 +1,7 @@ /** * External dependencies */ +const { DefinePlugin } = require( 'webpack' ); const LiveReloadPlugin = require( 'webpack-livereload-plugin' ); const CopyWebpackPlugin = require( 'copy-webpack-plugin' ); const postcss = require( 'postcss' ); @@ -103,7 +104,6 @@ module.exports = function( env = { environment: 'production', watch: false, buil 'block-library/src/rss/index.php': 'wp-includes/blocks/rss.php', 'block-library/src/search/index.php': 'wp-includes/blocks/search.php', 'block-library/src/shortcode/index.php': 'wp-includes/blocks/shortcode.php', - 'block-library/src/social-link/index.php': 'wp-includes/blocks/social-link.php', 'block-library/src/tag-cloud/index.php': 'wp-includes/blocks/tag-cloud.php', }; @@ -204,6 +204,10 @@ module.exports = function( env = { environment: 'production', watch: false, buil ], }, plugins: [ + new DefinePlugin( { + // Inject the `GUTENBERG_PHASE` global, used for feature flagging. + 'process.env.GUTENBERG_PHASE': 1, + } ), new LibraryExportDefaultPlugin( [ 'api-fetch', 'deprecated',