Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Forms: Remove duplicate display of form blocks under the "Jetpack" block inserter section; form blocks now only appear under the "Forms" category.
36 changes: 14 additions & 22 deletions projects/plugins/jetpack/class.jetpack-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ public static function enqueue_block_editor_assets() {

$jetpack_plan = Jetpack_Plan::get();
$initial_state = array(
'available_blocks' => self::get_availability(),
'blocks_variation' => $blocks_variation,
'modules' => $modules,
'jetpack' => array(
'available_blocks' => self::get_availability(),
'blocks_variation' => $blocks_variation,
'modules' => $modules,
'jetpack' => array(
'is_active' => Jetpack::is_connection_ready(),
'is_current_user_connected' => $is_current_user_connected,
/** This filter is documented in class.jetpack-gutenberg.php */
Expand All @@ -811,22 +811,14 @@ public static function enqueue_block_editor_assets() {
*/
'republicize_enabled' => apply_filters( 'jetpack_block_editor_republicize_feature', true ),
),
'siteFragment' => $status->get_site_suffix(),
'adminUrl' => esc_url( admin_url() ),
'tracksUserData' => $user_data,
'wpcomBlogId' => $blog_id,
'allowedMimeTypes' => wp_get_mime_types(),
'siteLocale' => str_replace( '_', '-', get_locale() ),
'ai-assistant' => $ai_assistant_state,
'screenBase' => $screen_base,
/**
* Should all blocks get registered the Jetpack block collection in addition to their own categories?
*
* @since 15.3
*
* @param boolean true Enable Jetpack block collection in block categories. Defaults to true.
*/
'registerBlockCollection' => apply_filters( 'jetpack_register_block_collection', true ),
'siteFragment' => $status->get_site_suffix(),
'adminUrl' => esc_url( admin_url() ),
'tracksUserData' => $user_data,
'wpcomBlogId' => $blog_id,
'allowedMimeTypes' => wp_get_mime_types(),
'siteLocale' => str_replace( '_', '-', get_locale() ),
'ai-assistant' => $ai_assistant_state,
'screenBase' => $screen_base,
/**
* Add your own feature flags to the block editor.
*
Expand All @@ -836,8 +828,8 @@ public static function enqueue_block_editor_assets() {
*
* @param array true Enable the RePublicize UI in the block editor context. Defaults to true.
*/
'feature_flags' => apply_filters( 'jetpack_block_editor_feature_flags', array() ),
'pluginBasePath' => plugins_url( '', Constants::get_constant( 'JETPACK__PLUGIN_FILE' ) ),
'feature_flags' => apply_filters( 'jetpack_block_editor_feature_flags', array() ),
'pluginBasePath' => plugins_url( '', Constants::get_constant( 'JETPACK__PLUGIN_FILE' ) ),
);

wp_localize_script(
Expand Down
9 changes: 1 addition & 8 deletions projects/plugins/jetpack/extensions/shared/block-category.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { JetpackLogo } from '@automattic/jetpack-shared-extension-utils/icons';
import { getCategories, setCategories, registerBlockCollection } from '@wordpress/blocks';
import { getCategories, setCategories } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';

if ( window?.Jetpack_Editor_Initial_State?.registerBlockCollection ) {
registerBlockCollection( 'jetpack', {
title: 'Jetpack',
icon: <JetpackLogo />,
} );
}

// We're moving Form specific blocks to a new 'Forms' category
// that should appear before the 'monetize' and 'grow' categories
setCategories( [
Expand Down
Loading