diff --git a/projects/plugins/jetpack/changelog/y b/projects/plugins/jetpack/changelog/y new file mode 100644 index 0000000000000..b4f4d55e5230d --- /dev/null +++ b/projects/plugins/jetpack/changelog/y @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Fix extra colon for form fields without label diff --git a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php index f079f21ca21b5..b94808f3fe7dc 100644 --- a/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php +++ b/projects/plugins/jetpack/modules/contact-form/grunion-contact-form.php @@ -2873,10 +2873,10 @@ public static function get_compiled_form( $feedback_id, $form ) { $field = $form->fields[ $field_id ]; $field_index = array_search( $field_id, $field_ids['all'], true ); - $label = $field->get_attribute( 'label' ); + $label = $field->get_attribute( 'label' ) ? $field->get_attribute( 'label' ) . ':' : ''; $compiled_form[ $field_index ] = sprintf( - '
%1$s:
%2$s
', + '
%1$s
%2$s
', wp_kses( $label, array() ), self::escape_and_sanitize_field_value( $extra_fields[ $extra_field_keys[ $i ] ] ) );