Skip to content
Closed
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: minor
Type: changed

Forms: consolidate beta blocks, remove forms_alpha filter
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function register_block() {
*/
public static function register_feature( $features ) {
// Features under development.
$features['image-select-field'] = apply_filters( 'forms_alpha', false );
$features['image-select-field'] = Blocks::get_variation() === 'beta' && apply_filters( 'forms_alpha', false );

// Features that are only available to users with a paid plan.
$features['multistep-form'] = Current_Plan::supports( 'multistep-form' );
Expand Down Expand Up @@ -226,22 +226,6 @@ public static function register_child_blocks() {
)
);

if ( Blocks::get_variation() === 'beta' ) {
Blocks::jetpack_register_block(
'jetpack/input-rating',
array(
'supports' => array(
'color' => array(
'text' => true,
'background' => false,
),
'typography' => array(
'fontSize' => true,
),
),
)
);
}
// Field render methods.
Blocks::jetpack_register_block(
'jetpack/field-text',
Expand Down Expand Up @@ -370,7 +354,9 @@ public static function register_child_blocks() {
)
);

// Blocks under development
if ( Blocks::get_variation() === 'beta' ) {

Blocks::jetpack_register_block(
'jetpack/field-rating',
array(
Expand All @@ -380,20 +366,62 @@ public static function register_child_blocks() {
),
)
);

Blocks::jetpack_register_block(
'jetpack/input-rating',
array(
'supports' => array(
'color' => array(
'text' => true,
'background' => false,
),
'typography' => array(
'fontSize' => true,
),
),
)
);

Blocks::jetpack_register_block(
'jetpack/field-slider',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_field_slider' ),
'provides_context' => array( 'jetpack/field-required' => 'required' ),
)
);

Blocks::jetpack_register_block(
'jetpack/field-time',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_field_time' ),
'provides_context' => array( 'jetpack/field-required' => 'required' ),
)
);

// Blocks under heavy development, not ready for testing yet
if ( apply_filters( 'forms_alpha', false ) ) {
Blocks::jetpack_register_block(
'jetpack/field-image-select',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_field_image_select' ),
'provides_context' => array( 'jetpack/field-required' => 'required' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-image-select-choices',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_image_select_choices' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-image-select-choice',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_image_select_choice' ),
)
);
}
}

// Paid file field block
Expand Down Expand Up @@ -450,31 +478,6 @@ public static function register_child_blocks() {
Blocks::jetpack_register_block(
'jetpack/form-step-container'
);

// Block under development.
if ( apply_filters( 'forms_alpha', false ) ) {
Blocks::jetpack_register_block(
'jetpack/field-image-select',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_field_image_select' ),
'provides_context' => array( 'jetpack/field-required' => 'required' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-image-select-choices',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_image_select_choices' ),
)
);

Blocks::jetpack_register_block(
'jetpack/form-image-select-choice',
array(
'render_callback' => array( Contact_Form_Plugin::class, 'gutenblock_render_form_image_select_choice' ),
)
);
}
}

/**
Expand Down
Loading