Merge pull request #17027 from builtbylane/patch-1
make hidden country/state readonly
This commit is contained in:
commit
4186a009ee
|
@ -2013,7 +2013,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
||||||
|
|
||||||
$field .= '<strong>' . current( array_values( $countries ) ) . '</strong>';
|
$field .= '<strong>' . current( array_values( $countries ) ) . '</strong>';
|
||||||
|
|
||||||
$field .= '<input type="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="' . current( array_keys( $countries ) ) . '" ' . implode( ' ', $custom_attributes ) . ' class="country_to_state" />';
|
$field .= '<input type="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="' . current( array_keys( $countries ) ) . '" ' . implode( ' ', $custom_attributes ) . ' class="country_to_state" readonly="readonly" />';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -2039,7 +2039,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
||||||
|
|
||||||
$field_container = '<p class="form-row %1$s" id="%2$s" style="display: none">%3$s</p>';
|
$field_container = '<p class="form-row %1$s" id="%2$s" style="display: none">%3$s</p>';
|
||||||
|
|
||||||
$field .= '<input type="hidden" class="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="" ' . implode( ' ', $custom_attributes ) . ' placeholder="' . esc_attr( $args['placeholder'] ) . '" />';
|
$field .= '<input type="hidden" class="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="" ' . implode( ' ', $custom_attributes ) . ' placeholder="' . esc_attr( $args['placeholder'] ) . '" readonly="readonly" />';
|
||||||
|
|
||||||
} elseif ( ! is_null( $for_country ) && is_array( $states ) ) {
|
} elseif ( ! is_null( $for_country ) && is_array( $states ) ) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue