Skip to content

Commit fbaf9bd

Browse files
enejbmatticbot
authored andcommitted
Forms: Enable Central Forms Management by default for all sites (#47826)
* Forms: Enable Central Forms Management by default for all sites Flip the jetpack_forms_alpha filter default from false to true and add the central-form-management editor feature flag from within the Forms package. This makes CFM available to all sites including self-hosted Jetpack installations, without requiring a feature flag. The wpcom flags file is updated to explicitly disable CFM for excluded sites (e2e test, disable sticker) rather than enabling for included ones, preserving the opt-out mechanism. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix forms e2e test: use explicit inner blocks to avoid synced form creation With CFM enabled by default, clicking the variation picker creates a synced form whose title comes from the variation (not the block's formTitle attribute). The test then fails looking for a form with the original title. Provide explicit innerBlocks when inserting the form block, matching the pattern already used by the second test. This keeps the form inline and preserves the formTitle attribute. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add changelog for Jetpack plugin e2e test update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Lets not introduce a new public method to enable the 'enable_central_form_management_flag' flag. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/24368126638 Upstream-Ref: Automattic/jetpack@80ea3fd
1 parent 0ffe4e6 commit fbaf9bd

8 files changed

Lines changed: 30 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [7.17.1-alpha] - unreleased
8+
## [7.18.0-alpha] - unreleased
99

1010
This is an alpha version! The changes listed here are not final.
1111

1212
### Changed
13+
- Enable Central Forms Management (wp-build dashboard and synced forms) by default for all sites, including self-hosted Jetpack installations.
1314
- Forms responses dashboard: request field values as a keyed collection from the API.
1415

1516
### Fixed
@@ -2434,7 +2435,7 @@ This is an alpha version! The changes listed here are not final.
24342435
- Added a new jetpack/forms package [#28409]
24352436
- Added a public load_contact_form method for initializing the contact form module. [#28416]
24362437

2437-
[7.17.1-alpha]: https://github.com/automattic/jetpack-forms/compare/v7.17.0...v7.17.1-alpha
2438+
[7.18.0-alpha]: https://github.com/automattic/jetpack-forms/compare/v7.17.0...v7.18.0-alpha
24382439
[7.17.0]: https://github.com/automattic/jetpack-forms/compare/v7.16.0...v7.17.0
24392440
[7.16.0]: https://github.com/automattic/jetpack-forms/compare/v7.15.0...v7.16.0
24402441
[7.15.0]: https://github.com/automattic/jetpack-forms/compare/v7.14.0...v7.15.0

build/constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
*/
1010

1111
return array(
12-
'version' => '7.17.1-alpha',
12+
'version' => '7.18.0-alpha',
1313
'build_url' => plugin_dir_url( __FILE__ ),
1414
);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"link-template": "https://github.com/automattic/jetpack-forms/compare/v${old}...v${new}"
6666
},
6767
"branch-alias": {
68-
"dev-trunk": "7.17.x-dev"
68+
"dev-trunk": "7.18.x-dev"
6969
},
7070
"textdomain": "jetpack-forms",
7171
"version-constants": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@automattic/jetpack-forms",
3-
"version": "7.17.1-alpha",
3+
"version": "7.18.0-alpha",
44
"private": true,
55
"description": "Jetpack Forms",
66
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/forms/#readme",

src/blocks/contact-form/class-contact-form-block.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ public static function register_feature( $features ) {
102102
$features['multistep-form'] = Current_Plan::supports( 'multistep-form' );
103103
$features['form-webhooks'] = Current_Plan::supports( 'form-webhooks' );
104104

105+
if ( ! isset( $features['central-form-management'] ) ) {
106+
$features['central-form-management'] = true;
107+
}
108+
105109
return $features;
106110
}
107111

src/class-jetpack-forms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class Jetpack_Forms {
1616

17-
const PACKAGE_VERSION = '7.17.1-alpha';
17+
const PACKAGE_VERSION = '7.18.0-alpha';
1818

1919
/**
2020
* Load the contact form module.

src/contact-form/class-contact-form-plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ public static function has_editor_feature_flag( $flag ) {
413413
$feature_flags = apply_filters( 'jetpack_block_editor_feature_flags', array() );
414414
return ! empty( $feature_flags[ $flag ] );
415415
}
416-
417416
/**
418417
* Remove feedback post type from the allowed post types for related posts.
419418
*
@@ -1566,7 +1565,8 @@ public function unread_count() {
15661565

15671566
// Jetpack submenu entries
15681567
foreach ( $submenu['jetpack'] as $index => $menu_item ) {
1569-
$admin_slug = apply_filters( 'jetpack_forms_alpha', false ) ? Dashboard::FORMS_WPBUILD_ADMIN_SLUG : Dashboard::ADMIN_SLUG;
1568+
/** This filter is documented in class-dashboard.php::init */
1569+
$admin_slug = apply_filters( 'jetpack_forms_alpha', true ) ? Dashboard::FORMS_WPBUILD_ADMIN_SLUG : Dashboard::ADMIN_SLUG;
15701570
if ( $admin_slug === $menu_item[2] ) {
15711571
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
15721572
$submenu['jetpack'][ $index ][0] .= $forms_unread_count_tag;

src/dashboard/class-dashboard.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,17 @@ public function init() {
170170
add_action( 'admin_menu', array( $this, 'add_admin_submenu' ), self::MENU_PRIORITY );
171171
add_action( 'admin_menu', array( __CLASS__, 'redirect_dashboard_url_cross_variant' ), 1 );
172172

173-
// Flag to enable the wp-build-based dashboard.
174-
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', false );
173+
/**
174+
* Filter to enable or disable the wp-build-based Forms dashboard.
175+
*
176+
* Enabled by default since Central Forms Management is now available for all sites.
177+
* Can be disabled by returning false from this filter.
178+
*
179+
* @since 7.18.0-alpha
180+
*
181+
* @param bool $enabled Whether the wp-build dashboard is enabled. Default true.
182+
*/
183+
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', true );
175184

176185
if ( $is_wp_build_enabled ) {
177186
self::load_wp_build();
@@ -200,7 +209,8 @@ public static function redirect_dashboard_url_cross_variant() {
200209
return;
201210
}
202211

203-
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', false );
212+
/** This filter is documented in class-dashboard.php::init */
213+
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', true );
204214

205215
// Legacy URL requested but wp-build is now active → redirect to wp-build.
206216
if ( $page === self::ADMIN_SLUG && $is_wp_build_enabled ) {
@@ -368,7 +378,8 @@ public function load_admin_scripts() {
368378
*/
369379
public function add_admin_submenu() {
370380

371-
if ( apply_filters( 'jetpack_forms_alpha', false ) ) {
381+
/** This filter is documented in class-dashboard.php::init */
382+
if ( apply_filters( 'jetpack_forms_alpha', true ) ) {
372383

373384
// `jetpack_forms_jetpack_forms_responses_wp_admin_render_page` is the callback generated by WP build script.
374385
$callback = function_exists( 'jetpack_forms_jetpack_forms_responses_wp_admin_render_page' )
@@ -553,7 +564,8 @@ public static function mark_classic_form_detected() {
553564
* @return string
554565
*/
555566
public static function get_forms_admin_url( $tab = null, $post_id = null ) {
556-
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', false );
567+
/** This filter is documented in class-dashboard.php::init */
568+
$is_wp_build_enabled = apply_filters( 'jetpack_forms_alpha', true );
557569
$url = admin_url( 'admin.php' );
558570

559571
$url .= $is_wp_build_enabled

0 commit comments

Comments
 (0)