From a11aa9d3f817ab0b76799b57ef2659dc7ef0abfc Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Mon, 6 Apr 2020 17:55:47 +0200 Subject: [PATCH] [not verified] Blocks: do not Jetpack collection on WordPress.com. (#15310) See https://github.com/Automattic/jetpack/pull/14454#issuecomment-608547942 --- extensions/shared/block-category.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index abe0ec106026f..abd2cb19ee1a9 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -8,23 +8,29 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import JetpackLogo from '../shared/jetpack-logo'; +import { isAtomicSite, isSimpleSite } from '../shared/site-type-utils'; /** * Return bool depending on registerBlockCollection compatibility. * * @todo When Jetpack's minimum is WP 5.4. Remove this function and update all block categories. * - * @return {boolean} Value to indicate function support. + * @returns {boolean} Value to indicate function support. */ export const supportsCollections = () => { return typeof registerBlockCollection === 'function'; }; +const isWpcom = isSimpleSite() || isAtomicSite(); + if ( supportsCollections() ) { - registerBlockCollection( 'jetpack', { - title: 'Jetpack', - icon: , - } ); + // We do not want the Jetpack collection on WordPress.com (Simple or Atomic). + if ( ! isWpcom ) { + registerBlockCollection( 'jetpack', { + title: 'Jetpack', + icon: , + } ); + } } else { // This can be removed once Jetpack's minimum is Core 5.4. setCategories( [