Skip to content

Commit 9e8c7a6

Browse files
committed
use the right field type for international phone number: phone
1 parent 374c9ca commit 9e8c7a6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

projects/packages/forms/src/contact-form/class-contact-form-field.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,8 @@ public function render_telephone_field( $id, $label, $value, $class, $required,
943943

944944
$link_label_id = $id . '-number';
945945

946-
$this->set_invalid_message( 'telephone', __( 'Please enter a valid phone number', 'jetpack-forms' ) );
947-
$label = $this->render_label( 'telephone', $link_label_id, $label, $required, $required_field_text );
946+
$this->set_invalid_message( 'phone', __( 'Please enter a valid phone number', 'jetpack-forms' ) );
947+
$label = $this->render_label( 'phone', $link_label_id, $label, $required, $required_field_text );
948948
if ( ! is_string( $value ) ) {
949949
$value = '';
950950
}
@@ -1015,7 +1015,7 @@ public function render_telephone_field( $id, $label, $value, $class, $required,
10151015
<?php
10161016
$input = ob_get_clean();
10171017

1018-
$field = $label . $input . $this->get_error_div( $id, 'telephone' );
1018+
$field = $label . $input . $this->get_error_div( $id, 'phone' );
10191019
return $field;
10201020
}
10211021

projects/packages/forms/src/contact-form/class-contact-form-plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ public static function gutenblock_render_field_date( $atts, $content, $block ) {
10001000
*/
10011001
public static function gutenblock_render_field_telephone( $atts, $content, $block ) {
10021002
// conversion telephone to phone
1003-
$type = empty( $atts['showcountryselector'] ) ? 'telephone' : 'phone';
1003+
$type = empty( $atts['showCountrySelector'] ) ? 'telephone' : 'phone';
10041004
$atts = self::block_attributes_to_shortcode_attributes( $atts, $type, $block );
10051005
return Contact_Form::parse_contact_field( $atts, $content, $block );
10061006
}

0 commit comments

Comments
 (0)